diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-15 20:50:38 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-06-15 20:50:38 +0000 |
commit | 0cc78cf484e3d25ea1d98cda9160442af1a1a32d (patch) | |
tree | a2228860af517eefd8787a739e01d00b4062e587 /coreutils/sort.c | |
parent | 10572ca84b54e6903f898841b63149012b7d175f (diff) | |
download | busybox-w32-0cc78cf484e3d25ea1d98cda9160442af1a1a32d.tar.gz busybox-w32-0cc78cf484e3d25ea1d98cda9160442af1a1a32d.tar.bz2 busybox-w32-0cc78cf484e3d25ea1d98cda9160442af1a1a32d.zip |
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.
git-svn-id: svn://busybox.net/trunk/busybox@15397 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/sort.c')
-rw-r--r-- | coreutils/sort.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c index fb58f6279..3354385a4 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) | |||
74 | for(i=1;i<key->range[2*j]+j;i++) { | 74 | for(i=1;i<key->range[2*j]+j;i++) { |
75 | /* Skip leading blanks or first separator */ | 75 | /* Skip leading blanks or first separator */ |
76 | if(str[end]) { | 76 | if(str[end]) { |
77 | if(key_separator) { | 77 | if(!key_separator && isspace(str[end])) |
78 | if(str[end]==key_separator) end++; | ||
79 | } else if(isspace(str[end])) | ||
80 | while(isspace(str[end])) end++; | 78 | while(isspace(str[end])) end++; |
81 | } | 79 | } |
82 | /* Skip body of key */ | 80 | /* Skip body of key */ |