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
This commit is contained in:
Denis Vlasenko
2007-01-07 00:21:41 +00:00
parent 8a820b2732
commit 8336f080cb
3 changed files with 79 additions and 68 deletions

View File

@@ -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)