Module Name:    src
Committed By:   dholland
Date:           Sat Jun  5 17:44:51 UTC 2010

Modified Files:
        src/usr.bin/sort: sort.c sort.h

Log Message:
fixit() needs to know the getopt options list to do its thing correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/sort/sort.c
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/sort/sort.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/sort/sort.c
diff -u src/usr.bin/sort/sort.c:1.58 src/usr.bin/sort/sort.c:1.59
--- src/usr.bin/sort/sort.c:1.58	Fri Feb  5 21:58:42 2010
+++ src/usr.bin/sort/sort.c	Sat Jun  5 17:44:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sort.c,v 1.58 2010/02/05 21:58:42 enami Exp $	*/
+/*	$NetBSD: sort.c,v 1.59 2010/06/05 17:44:51 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
  The Regents of the University of California.  All rights reserved.");
 #endif /* not lint */
 
-__RCSID("$NetBSD: sort.c,v 1.58 2010/02/05 21:58:42 enami Exp $");
+__RCSID("$NetBSD: sort.c,v 1.59 2010/06/05 17:44:51 dholland Exp $");
 
 #include <sys/types.h>
 #include <sys/time.h>
@@ -147,13 +147,15 @@
 	fldtab = emalloc(fldtab_sz * sizeof(*fldtab));
 	memset(fldtab, 0, fldtab_sz * sizeof(*fldtab));
 
+#define SORT_OPTS "bcdD:fik:mHno:rR:sSt:T:ux"
+
 	/* Convert "+field" args to -f format */
-	fixit(&argc, argv);
+	fixit(&argc, argv, SORT_OPTS);
 
 	if (!(tmpdir = getenv("TMPDIR")))
 		tmpdir = _PATH_TMP;
 
-	while ((ch = getopt(argc, argv, "bcdD:fik:mHno:rR:sSt:T:ux")) != -1) {
+	while ((ch = getopt(argc, argv, SORT_OPTS)) != -1) {
 		switch (ch) {
 		case 'b':
 			fldtab[0].flags |= BI | BT;

Index: src/usr.bin/sort/sort.h
diff -u src/usr.bin/sort/sort.h:1.31 src/usr.bin/sort/sort.h:1.32
--- src/usr.bin/sort/sort.h:1.31	Fri Feb  5 21:58:42 2010
+++ src/usr.bin/sort/sort.h	Sat Jun  5 17:44:51 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: sort.h,v 1.31 2010/02/05 21:58:42 enami Exp $	*/
+/*	$NetBSD: sort.h,v 1.32 2010/06/05 17:44:51 dholland Exp $	*/
 
 /*-
  * Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@@ -178,7 +178,7 @@
 void	 append(RECHEADER **, int, FILE *, void (*)(const RECHEADER *, FILE *));
 void	 concat(FILE *, FILE *);
 length_t enterkey(RECHEADER *, const u_char *, u_char *, size_t, struct field *);
-void	 fixit(int *, char **);
+void	 fixit(int *, char **, const char *);
 void	 fldreset(struct field *);
 FILE	*ftmp(void);
 void	 fmerge(struct filelist *, int, FILE *, struct field *);

Reply via email to