summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorRob Landley2006-06-15 20:50:38 +0000
committerRob Landley2006-06-15 20:50:38 +0000
commit39218932b1e99be6ef91329f7fb1beeeb40941c1 (patch)
treea2228860af517eefd8787a739e01d00b4062e587 /coreutils
parentcd82c3c041139c03fceea7e76fb48280b00d73da (diff)
downloadbusybox-39218932b1e99be6ef91329f7fb1beeeb40941c1.zip
busybox-39218932b1e99be6ef91329f7fb1beeeb40941c1.tar.gz
Fix bug found by Joey Hess and forwarded by Bastian Bunk. Add Joey Hess's
test case to the testsuite, plus another one that would have been broken by the first attempt at a fix.
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/sort.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c
index fb58f62..3354385 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -74,9 +74,7 @@ static char *get_key(char *str, struct sort_key *key, int flags)
for(i=1;i<key->range[2*j]+j;i++) {
/* Skip leading blanks or first separator */
if(str[end]) {
- if(key_separator) {
- if(str[end]==key_separator) end++;
- } else if(isspace(str[end]))
+ if(!key_separator && isspace(str[end]))
while(isspace(str[end])) end++;
}
/* Skip body of key */