Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/sort alltable[], itable[], dtable[] were moved to in...
details: https://anonhg.NetBSD.org/src/rev/79da02aa4678
branches: trunk
changeset: 502160:79da02aa4678
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Fri Jan 12 19:41:12 2001 +0000
description:
alltable[], itable[], dtable[] were moved to init.c, g/c from sort.[ch]
put extern declaration for gweights[] to sort.h
add -s/-S to usage(), couple of formating nits
diffstat:
usr.bin/sort/sort.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
diffs (67 lines):
diff -r 7f703a42b653 -r 79da02aa4678 usr.bin/sort/sort.c
--- a/usr.bin/sort/sort.c Fri Jan 12 19:39:02 2001 +0000
+++ b/usr.bin/sort/sort.c Fri Jan 12 19:41:12 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sort.c,v 1.14 2001/01/11 15:10:46 jdolecek Exp $ */
+/* $NetBSD: sort.c,v 1.15 2001/01/12 19:41:13 jdolecek Exp $ */
/*-
* Copyright (c) 1993
@@ -51,7 +51,7 @@
#endif /* not lint */
#ifndef lint
-__RCSID("$NetBSD: sort.c,v 1.14 2001/01/11 15:10:46 jdolecek Exp $");
+__RCSID("$NetBSD: sort.c,v 1.15 2001/01/12 19:41:13 jdolecek Exp $");
__SCCSID("@(#)sort.c 8.1 (Berkeley) 6/6/93");
#endif /* not lint */
@@ -68,12 +68,7 @@
* weight tables. Gweights is one of ascii, Rascii..
* modified to weight rec_d = 0 (or 255)
*/
-extern u_char gweights[NBINS];
u_char ascii[NBINS], Rascii[NBINS], RFtable[NBINS], Ftable[NBINS];
-/*
- * masks of ignored characters. Alltable is 256 ones
- */
-u_char dtable[NBINS], itable[NBINS], alltable[NBINS];
int SINGL_FLD = 0, SEP_FLAG = 0, UNIQUE = 0;
struct coldesc clist[(ND+1)*2];
int ncols = 0;
@@ -127,11 +122,11 @@
break;
case 'd': case 'f': case 'i': case 'n': case 'r':
tmp |= optval(ch, 0);
- if (tmp & R && tmp & F)
+ if ((tmp & R) && (tmp & F))
fldtab->weights = RFtable;
else if (tmp & F)
fldtab->weights = Ftable;
- else if(tmp & R)
+ else if (tmp & R)
fldtab->weights = Rascii;
fldtab->flags |= tmp;
break;
@@ -225,10 +220,12 @@
optind--;
} else
filelist.names = (const char * const *) &argv[optind];
+
if (SINGL_FLD)
get = makeline;
else
get = makekey;
+
if (cflag) {
order(&filelist, get, fldtab);
/* NOT REACHED */
@@ -300,7 +297,7 @@
{
if (msg)
(void)fprintf(stderr, "sort: %s\n", msg);
- (void)fprintf(stderr, "usage: [-o output] [-cmubdfinr] [-t char] ");
+ (void)fprintf(stderr, "usage: [-o output] [-cmubdfinrsS] [-t char] ");
(void)fprintf(stderr, "[-T char] [-k keydef] ... [files]\n");
exit(2);
}
Home |
Main Index |
Thread Index |
Old Index