Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!uxc!uxc.cso.uiuc.edu!ux1.cso.uiuc.edu!uicsrd.csrd.uiuc.edu!pickert From: pickert@uicsrd.csrd.uiuc.edu Newsgroups: comp.os.minix Subject: Bug fix for minix sort Message-ID: <5000006@uicsrd.csrd.uiuc.edu> Date: 20 May 89 18:50:00 GMT Lines: 60 Nf-ID: #N:uicsrd.csrd.uiuc.edu:5000006:000:1526 Nf-From: uicsrd.csrd.uiuc.edu!pickert May 20 13:50:00 1989 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. */