From 7c9239b092687212692b33fd3bc949bbc97bda80 Mon Sep 17 00:00:00 2001 From: Eric Jackson Date: Sun, 4 Feb 2001 21:27:02 +0000 Subject: Bring in some recent fixup's from NetBSD. This allows lines longer than 65522 to be properly sorted. Many other cleanup's done, and depreciate register. millert@ and deraadt@ ok. --- usr.bin/sort/sort.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'usr.bin/sort/sort.c') diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c index 7da39b63aeb..d9d1676c202 100644 --- a/usr.bin/sort/sort.c +++ b/usr.bin/sort/sort.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sort.c,v 1.15 2001/01/19 17:58:18 deraadt Exp $ */ +/* $OpenBSD: sort.c,v 1.16 2001/02/04 21:27:01 ericj Exp $ */ /*- * Copyright (c) 1993 @@ -46,7 +46,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)sort.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: sort.c,v 1.15 2001/01/19 17:58:18 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: sort.c,v 1.16 2001/02/04 21:27:01 ericj Exp $"; #endif #endif /* not lint */ @@ -62,6 +62,7 @@ static char rcsid[] = "$OpenBSD: sort.c,v 1.15 2001/01/19 17:58:18 deraadt Exp $ #include #include +#include #include #include #include @@ -119,6 +120,8 @@ main(argc, argv) FILE *outfp = NULL; void *p; + setlocale(LC_ALL, ""); + if ((clist = calloc((ND+1)*2, sizeof(struct coldesc))) == NULL || (ftpos = fldtab = calloc(ND+2, sizeof(struct field))) == NULL) errx(2, "cannot allocate memory"); @@ -331,7 +334,7 @@ usage(msg) { extern char *__progname; - if (msg) + if (msg != NULL) warnx("%s", msg); (void)fprintf(stderr, "usage: %s [-T dir] [-o output] [-cmubdfinrH] " "[-t char] [-R char] [-k keydef] ... [files]\n", __progname); -- cgit v1.2.3