aboutsummaryrefslogtreecommitdiff
path: root/coreutils/sort.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-07 00:21:41 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-07 00:21:41 +0000
commit8336f080cb921a8c64c4cea59463363144e97c1d (patch)
tree107879fed239680db64187e43889648a79e71192 /coreutils/sort.c
parent8a820b2732ec1672401cb5117437adcdc652b18b (diff)
downloadbusybox-8336f080cb921a8c64c4cea59463363144e97c1d.tar.gz
diff: small optimizations; do not try to diff non-seekable stream
(currently we don't support that) sort: fixes. testsuites fixed: sort with non-default leading delim 1 sort with non-default leading delim 2 sort key doesn't strip leading blanks, disables fallback global sort
Diffstat (limited to 'coreutils/sort.c')
-rw-r--r--coreutils/sort.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c
index c7abc3355..29cadf5f6 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -75,14 +75,10 @@ static char *get_key(char *str, struct sort_key *key, int flags)
end = 0;
for (i = 1; i < key->range[2*j] + j; i++) {
if (key_separator) {
- /* Skip first separator */
- while (str[end] == key_separator)
- end++;
- /* Skip body of key */
+ /* Skip body of key and separator */
while (str[end]) {
- if (str[end] == key_separator)
+ if (str[end++] == key_separator)
break;
- end++;
}
} else {
/* Skip leading blanks */
@@ -99,9 +95,6 @@ static char *get_key(char *str, struct sort_key *key, int flags)
}
if (!j) start = end;
}
- /* Key with explicit separator starts after separator */
- if (key_separator && str[start] == key_separator)
- start++;
/* Strip leading whitespace if necessary */
//XXX: skip_whitespace()
if (flags & FLAG_b)