diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2003-06-22 23:51:23 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2003-06-22 23:51:23 +0000 |
commit | 68e9b481b25028d497447e7d2dc11eeefb6b45c3 (patch) | |
tree | dff7dc3c273648b48e8583adf93a7b67f7a4cab9 /usr.bin/grep | |
parent | 3849dd0b73e19ba0100eeffd15d4d711086d394e (diff) |
use __progname instead of progname. ok deraadt
Diffstat (limited to 'usr.bin/grep')
-rw-r--r-- | usr.bin/grep/grep.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 66b3791c0fc..a955223851c 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grep.c,v 1.7 2003/06/22 23:12:38 deraadt Exp $ */ +/* $OpenBSD: grep.c,v 1.8 2003/06/22 23:51:22 tedu Exp $ */ /*- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav @@ -86,7 +86,7 @@ int first; /* flag whether or not this is our fist match */ int tail; /* lines left to print */ int lead; /* number of lines in leading context queue */ -char *progname; +extern char *__progname; static void usage(void) @@ -97,7 +97,7 @@ usage(void) #else "usage: %s [-[AB] num] [-CEFGHLPRSVZabchilnoqsvwx]" #endif - " [-e pattern] [-f file] [file ...]\n", progname); + " [-e pattern] [-f file] [file ...]\n", __progname); exit(2); } @@ -195,11 +195,6 @@ main(int argc, char *argv[]) char *tmp; int c, i; - if ((progname = strrchr(*argv, '/')) != NULL) - ++progname; - else - progname = *argv; - while ((c = getopt_long(argc, argv, optstr, long_options, (int *)NULL)) != -1) { switch (c) { @@ -330,7 +325,7 @@ main(int argc, char *argv[]) ++argv; } - switch (*progname) { + switch (__progname[0]) { case 'e': Eflag++; break; @@ -343,7 +338,7 @@ main(int argc, char *argv[]) #ifndef NOZ case 'z': Zflag++; - switch(progname[1]) { + switch(__progname[1]) { case 'e': Eflag++; break; |