From owner-p4-projects@FreeBSD.ORG Wed May 7 19:55:45 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 13CCA106568C; Wed, 7 May 2008 19:55:45 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8BB4106567B for ; Wed, 7 May 2008 19:55:44 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id BDB978FC0A for ; Wed, 7 May 2008 19:55:44 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m47JtiGw058801 for ; Wed, 7 May 2008 19:55:44 GMT (envelope-from gabor@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m47JtiUo058799 for perforce@freebsd.org; Wed, 7 May 2008 19:55:44 GMT (envelope-from gabor@freebsd.org) Date: Wed, 7 May 2008 19:55:44 GMT Message-Id: <200805071955.m47JtiUo058799@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gabor@freebsd.org using -f From: Gabor Kovesdan To: Perforce Change Reviews Cc: Subject: PERFORCE change 141296 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2008 19:55:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=141296 Change 141296 by gabor@gabor_server on 2008/05/07 19:55:39 - Swap -o and -H so that -H match GNU functionality. -o is a plus functionality from OpenBSD, it will be renamed later when I implement the GNU-compatible -o. Affected files ... .. //depot/projects/soc2008/gabor_textproc/grep/grep.c#7 edit .. //depot/projects/soc2008/gabor_textproc/grep/grep.h#7 edit .. //depot/projects/soc2008/gabor_textproc/grep/util.c#9 edit Differences ... ==== //depot/projects/soc2008/gabor_textproc/grep/grep.c#7 (text+ko) ==== @@ -70,7 +70,7 @@ int Eflag; /* -E: interpret pattern as extended regexp */ int Fflag; /* -F: interpret pattern as list of fixed strings */ int Gflag; /* -G: interpret pattern as basic regexp */ -int Hflag; /* -H: if -R, follow explicitly listed symlinks */ +int Hflag; /* -H: always print file name */ int Lflag; /* -L: only show names of files with no matches */ int Pflag; /* -P: if -R, no symlinks are followed */ int Rflag; /* -R: recursively search directory trees */ @@ -82,7 +82,7 @@ int iflag; /* -i: ignore case */ int lflag; /* -l: only show names of files with matches */ int nflag; /* -n: show line numbers in front of matching lines */ -int oflag; /* -o: always print file name */ +int oflag; /* -o: if -R, follow explicitly listed symlinks */ int qflag; /* -q: quiet mode (don't output anything) */ int sflag; /* -s: silent mode (ignore errors) */ int vflag; /* -v: only show non-matching lines */ @@ -153,8 +153,7 @@ {"file", required_argument, NULL, 'f'}, {"basic-regexp", no_argument, NULL, 'G'}, {"no-filename", no_argument, NULL, 'h'}, -/* XXX: UNIMPLEMENTED / INCOMPATIBLE - {"with-filename", no_argument, NULL, 'H'}, */ + {"with-filename", no_argument, NULL, 'H'}, {"ignore-case", no_argument, NULL, 'i'}, /* XXX: UNIMPLEMENTED {"bz2decompress", no_argument, NULL, 'J'}, */ @@ -353,7 +352,7 @@ Hflag++; break; case 'h': - oflag = 0; + Hflag = 0; hflag = 1; break; case 'I': @@ -376,8 +375,7 @@ nflag = 1; break; case 'o': - hflag = 0; - oflag = 1; + oflag++; break; case 'P': Pflag++; @@ -391,7 +389,7 @@ case 'R': case 'r': Rflag++; - oflag++; + Hflag++; break; case 's': sflag = 1; @@ -488,7 +486,7 @@ if (lbflag) setlinebuf(stdout); - if ((argc == 0 || argc == 1) && !oflag) + if ((argc == 0 || argc == 1) && !Hflag) hflag = 1; if (argc == 0) ==== //depot/projects/soc2008/gabor_textproc/grep/grep.h#7 (text+ko) ==== @@ -62,7 +62,7 @@ /* Command line flags */ extern int Aflag, Bflag, Eflag, Fflag, Gflag, Hflag, Lflag, Pflag, Sflag, Rflag, Zflag, - bflag, cflag, hflag, iflag, lflag, nflag, qflag, sflag, + bflag, cflag, hflag, iflag, lflag, nflag, oflag, qflag, sflag, vflag, wflag, xflag, nullflag; extern char *label; ==== //depot/projects/soc2008/gabor_textproc/grep/util.c#9 (text+ko) ==== @@ -69,7 +69,7 @@ c = fts_flags = 0; - if (Hflag) + if (oflag) fts_flags = FTS_COMFOLLOW; if (Pflag) fts_flags = FTS_PHYSICAL;