pickert@uicsrd.csrd.uiuc.edu (05/21/89)
Below is a bug fix for minix sort. The problem shows up
when attempting to sort a few lines of the form:
10,12
14,10
15,123
by invoking it as:
"sort -t, +2 file"
Joe Pickert
pickert@uicsrd.csrd.uiuc.edu
*** sort.c Thu Sep 29 08:09:13 1988
--- /tmp/sort.c Fri May 19 08:55:57 1989
***************
*** 757,777 ****
while (nf-- > 0) {
if (separator == '\0') { /* Means ' ' or '\t' */
while (*str != ' ' && *str != '\t' && *str != '\n')
str++;
while (table[*str] & BLANK)
str++;
}
else {
while (*str != separator && *str != '\n')
str++;
! str++;
}
}
return str; /* Return pointer to indicated field */
}
/*
* Compare is called by all sorting routines. It checks if fields assignments
* has been made. if so, it calls cmp_fields (). If not, it calls cmp () and
* reversed the return value if the (global) reverse flag is set.
*/
--- 757,777 ----
while (nf-- > 0) {
if (separator == '\0') { /* Means ' ' or '\t' */
while (*str != ' ' && *str != '\t' && *str != '\n')
str++;
while (table[*str] & BLANK)
str++;
}
else {
while (*str != separator && *str != '\n')
str++;
! if (*str != '\n') str++;
}
}
return str; /* Return pointer to indicated field */
}
/*
* Compare is called by all sorting routines. It checks if fields assignments
* has been made. if so, it calls cmp_fields (). If not, it calls cmp () and
* reversed the return value if the (global) reverse flag is set.
*/