aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreutils/sort.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/coreutils/sort.c b/coreutils/sort.c
index 1ba05ecd7..a6c56ad88 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -51,7 +51,7 @@ static struct sort_key
51 51
52static char *get_key(char *str, struct sort_key *key, int flags) 52static char *get_key(char *str, struct sort_key *key, int flags)
53{ 53{
54 int start=0,end,len,i,j; 54 int start = 0, end = 0, len, i, j;
55 55
56 /* Special case whole string, so we don't have to make a copy */ 56 /* Special case whole string, so we don't have to make a copy */
57 if(key->range[0]==1 && !key->range[1] && !key->range[2] && !key->range[3] 57 if(key->range[0]==1 && !key->range[1] && !key->range[2] && !key->range[3]
@@ -83,6 +83,7 @@ static char *get_key(char *str, struct sort_key *key, int flags)
83 /* Key with explicit separator starts after separator */ 83 /* Key with explicit separator starts after separator */
84 if(key_separator && str[start]==key_separator) start++; 84 if(key_separator && str[start]==key_separator) start++;
85 /* Strip leading whitespace if necessary */ 85 /* Strip leading whitespace if necessary */
86//XXX: skip_whitespace()
86 if(flags&FLAG_b) while(isspace(str[start])) start++; 87 if(flags&FLAG_b) while(isspace(str[start])) start++;
87 /* Strip trailing whitespace if necessary */ 88 /* Strip trailing whitespace if necessary */
88 if(flags&FLAG_bb) while(end>start && isspace(str[end-1])) end--; 89 if(flags&FLAG_bb) while(end>start && isspace(str[end-1])) end--;