From 39218932b1e99be6ef91329f7fb1beeeb40941c1 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 15 Jun 2006 20:50:38 +0000 Subject: 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. --- coreutils/sort.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'coreutils/sort.c') 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) for(i=1;irange[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 */ -- cgit v1.2.3