diff options
author | ru <ru@FreeBSD.org> | 2000-01-04 10:32:55 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2000-01-04 10:32:55 +0000 |
commit | 0c24bbce8ce727cd0eaf684488671e99107a5f1c (patch) | |
tree | e3df464a326ed9c48f9374bf84d881bcc44654e1 /gnu/usr.bin | |
parent | 96120df22feb2ea6ec34c8130d7fb5b67f66bc44 (diff) | |
download | FreeBSD-src-0c24bbce8ce727cd0eaf684488671e99107a5f1c.zip FreeBSD-src-0c24bbce8ce727cd0eaf684488671e99107a5f1c.tar.gz |
* Make --null option work in (HAVE_LIBZ > 0) case.
* Remove "why we need this decl..." comment. The `matcher' variable
is defined in *grepmat.c files in the original distribution, which
we did not import.
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/grep/grep.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/gnu/usr.bin/grep/grep.c b/gnu/usr.bin/grep/grep.c index 79c7c48..a45df88 100644 --- a/gnu/usr.bin/grep/grep.c +++ b/gnu/usr.bin/grep/grep.c @@ -61,13 +61,12 @@ static int show_version; /* If nonzero, use mmap if possible. */ static int mmap_option; +/* If zero, output nulls after filenames. */ +static int filename_mask; + /* Short options. */ static char const short_options[] = -#if HAVE_LIBZ > 0 "0123456789A:B:C::EFGHUVX:abcd:e:f:hiLlnqrsuvwxyZz"; -#else -"0123456789A:B:C::EFGHUVX:abcd:e:f:hiLlnqrsuvwxyZz"; -#endif /* Long options equivalences. */ static struct option long_options[] = @@ -93,7 +92,8 @@ static struct option long_options[] = {"no-filename", no_argument, NULL, 'h'}, {"no-messages", no_argument, NULL, 's'}, #if HAVE_LIBZ > 0 - {"null", no_argument, NULL, /*'Z'*/ 1}, + {"decompress", no_argument, NULL, 'Z'}, + {"null", no_argument, &filename_mask, 0}, #else {"null", no_argument, NULL, 'Z'}, #endif @@ -109,15 +109,10 @@ static struct option long_options[] = {"version", no_argument, NULL, 'V'}, {"with-filename", no_argument, NULL, 'H'}, {"word-regexp", no_argument, NULL, 'w'}, -#if HAVE_LIBZ > 0 - {"decompress", no_argument, NULL, 'Z'}, -#endif {0, 0, 0, 0} }; /* Define flags declared in grep.h. */ -/* I do not know why we need this decl, while if you build GNU grep 2.4 by - hand you don't... */ char const *matcher; int match_icase; int match_words; @@ -517,7 +512,6 @@ fillbuf (save, stats) /* Flags controlling the style of output. */ static int always_text; /* Assume the input is always text. */ -static int filename_mask; /* If zero, output nulls after filenames. */ static int out_quiet; /* Suppress all normal output. */ static int out_invert; /* Print nonmatching stuff. */ static int out_file; /* Print filenames. */ |