Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/sort fixit() needs to know the getopt options list t...



details:   https://anonhg.NetBSD.org/src/rev/e5cc13a843eb
branches:  trunk
changeset: 755425:e5cc13a843eb
user:      dholland <dholland%NetBSD.org@localhost>
date:      Sat Jun 05 17:44:51 2010 +0000

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

diffstat:

 usr.bin/sort/sort.c |  10 ++++++----
 usr.bin/sort/sort.h |   4 ++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r 753e8562f03f -r e5cc13a843eb usr.bin/sort/sort.c
--- a/usr.bin/sort/sort.c       Sat Jun 05 16:57:48 2010 +0000
+++ b/usr.bin/sort/sort.c       Sat Jun 05 17:44:51 2010 +0000
@@ -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;
diff -r 753e8562f03f -r e5cc13a843eb usr.bin/sort/sort.h
--- a/usr.bin/sort/sort.h       Sat Jun 05 16:57:48 2010 +0000
+++ b/usr.bin/sort/sort.h       Sat Jun 05 17:44:51 2010 +0000
@@ -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 *);



Home | Main Index | Thread Index | Old Index