=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sort/Attic/fields.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- src/usr.bin/sort/Attic/fields.c 1997/01/20 19:39:49 1.1 +++ src/usr.bin/sort/Attic/fields.c 1997/06/16 02:21:54 1.2 @@ -1,4 +1,4 @@ -/* $OpenBSD: fields.c,v 1.1 1997/01/20 19:39:49 millert Exp $ */ +/* $OpenBSD: fields.c,v 1.2 1997/06/16 02:21:54 millert Exp $ */ /*- * Copyright (c) 1993 @@ -40,7 +40,7 @@ #if 0 static char sccsid[] = "@(#)fields.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: fields.c,v 1.1 1997/01/20 19:39:49 millert Exp $"; +static char rcsid[] = "$OpenBSD: fields.c,v 1.2 1997/06/16 02:21:54 millert Exp $"; #endif #endif /* not lint */ @@ -110,14 +110,14 @@ col++; if (pos >= lineend) { clpos->end = lineend; - ++i; + i++; break; } } for (; i <= ncols; i++) clist[i].start = clist[i].end = lineend; if (clist[0].start < (u_char *) line->data) - ++clist[0].start; + clist[0].start++; endkey = (u_char *) keybuf + size - line->size; for (ftpos = fieldtable + 1; ftpos->icol.num; ftpos++) if ((keypos = enterfield(keypos, endkey, ftpos, @@ -147,6 +147,7 @@ struct column icol, tcol; register u_int flags; u_int Rflag; + icol = cur_fld->icol; tcol = cur_fld->tcol; flags = cur_fld->flags; @@ -156,12 +157,14 @@ blancmange(start); start += icol.indent; start = min(start, lineend); + if (!tcol.num) end = lineend; else { if (tcol.indent) { end = tcol.p->start; - if (flags & BT) blancmange(end); + if (flags & BT) + blancmange(end); end += tcol.indent; end = min(end, lineend); } else @@ -185,7 +188,7 @@ } else { *tablepos++ = lweight[*start]; if (tablepos == endkey) - return (NULL); + return (NULL); } } *tablepos++ = lweight[0]; @@ -203,7 +206,7 @@ * if the exponent is exactly 61, 61+252, etc--this is ok, since it's the * only time a field delimiter can come in that position. * Reverse order is done analagously. -*/ + */ u_char * number(pos, bufend, line, lineend, Rflag) @@ -222,8 +225,10 @@ nweights = fnum; if (pos > bufend - 8) return (NULL); - /* or_sign sets the sort direction: - * (-r: +/-)(sign: +/-)(expsign: +/-) */ + /* + * or_sign sets the sort direction: + * (-r: +/-)(sign: +/-)(expsign: +/-) + */ or_sign = sign ^ expsign ^ Rflag; blancmange(line); if (*line == '-') { /* set the sign */ @@ -232,7 +237,8 @@ line++; } /* eat initial zeroes */ - for (; *line == '0' && line < lineend; line++); + for (; *line == '0' && line < lineend; line++) + ; /* calculate exponents < 0 */ if (*line == DECIMAL) { exponent = 1; @@ -301,7 +307,7 @@ /* This forces a gap around the record delimiter * Thus fnum has vaues over (0,254) -> ((0,REC_D-1),(REC_D+1,255)); * rnum over (0,254) -> (255,REC_D+1),(REC_D-1,0)) -*/ + */ void num_init() { @@ -311,15 +317,15 @@ OFF_TENS = TENS - '0'; OFF_NTENS = NEGTENS - '0'; for (i = 1; i < 10; i++) { - TENS[i] = TENS[i-1] + 10; - NEGTENS[i] = NEGTENS[i-1] - 10; + TENS[i] = TENS[i - 1] + 10; + NEGTENS[i] = NEGTENS[i - 1] - 10; } for (i = 0; i < REC_D; i++) { fnum[i] = i; - rnum[255-i] = i; + rnum[255 - i] = i; } for (i = REC_D; i <255; i++) { - fnum[i] = i+1; - rnum[255-i] = i-1; + fnum[i] = i + 1; + rnum[255 - i] = i - 1; } }