aboutsummaryrefslogtreecommitdiff
path: root/coreutils/sort.c
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-01-07 00:21:41 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-01-07 00:21:41 +0000
commit0514d50e3d5847394388c781fad158999cf3b338 (patch)
tree107879fed239680db64187e43889648a79e71192 /coreutils/sort.c
parentf2236c0885cb06c667239aead0697d45c999fa72 (diff)
downloadbusybox-w32-0514d50e3d5847394388c781fad158999cf3b338.tar.gz
busybox-w32-0514d50e3d5847394388c781fad158999cf3b338.tar.bz2
busybox-w32-0514d50e3d5847394388c781fad158999cf3b338.zip
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 git-svn-id: svn://busybox.net/trunk/busybox@17175 69ca8d6d-28ef-0310-b511-8ec308f3f277
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)
75 end = 0; 75 end = 0;
76 for (i = 1; i < key->range[2*j] + j; i++) { 76 for (i = 1; i < key->range[2*j] + j; i++) {
77 if (key_separator) { 77 if (key_separator) {
78 /* Skip first separator */ 78 /* Skip body of key and separator */
79 while (str[end] == key_separator)
80 end++;
81 /* Skip body of key */
82 while (str[end]) { 79 while (str[end]) {
83 if (str[end] == key_separator) 80 if (str[end++] == key_separator)
84 break; 81 break;
85 end++;
86 } 82 }
87 } else { 83 } else {
88 /* Skip leading blanks */ 84 /* Skip leading blanks */
@@ -99,9 +95,6 @@ static char *get_key(char *str, struct sort_key *key, int flags)
99 } 95 }
100 if (!j) start = end; 96 if (!j) start = end;
101 } 97 }
102 /* Key with explicit separator starts after separator */
103 if (key_separator && str[start] == key_separator)
104 start++;
105 /* Strip leading whitespace if necessary */ 98 /* Strip leading whitespace if necessary */
106//XXX: skip_whitespace() 99//XXX: skip_whitespace()
107 if (flags & FLAG_b) 100 if (flags & FLAG_b)