From 8696c1b71e66bc3ca0d0327d67dc2416717cda8e Mon Sep 17 00:00:00 2001 From: dholland Date: Sat, 5 Jun 2010 17:44:51 +0000 Subject: [PATCH] fixit() needs to know the getopt options list to do its thing correctly. --- usr.bin/sort/sort.c | 10 ++++++---- usr.bin/sort/sort.h | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c index fc390844a28d..2c83009e672d 100644 --- a/usr.bin/sort/sort.c +++ b/usr.bin/sort/sort.c @@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1993\ 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 #include @@ -147,13 +147,15 @@ main(int argc, char *argv[]) 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 --git a/usr.bin/sort/sort.h b/usr.bin/sort/sort.h index 39d59bc17966..b151427ec107 100644 --- a/usr.bin/sort/sort.h +++ b/usr.bin/sort/sort.h @@ -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 @@ RECHEADER *allocrec(RECHEADER *, size_t); 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 *);