From 789c760d1bdcc93c22862bfeb8fad6c30860d53e Mon Sep 17 00:00:00 2001 From: jkim Date: Wed, 26 Oct 2005 21:13:30 +0000 Subject: [PATCH] MFC: Fix a longstanding buglet in bz-prefixed grep(1). PR: gnu/72200 Approved by: re --- gnu/usr.bin/grep/grep.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gnu/usr.bin/grep/grep.c b/gnu/usr.bin/grep/grep.c index 04a166720420..1684a820b670 100644 --- a/gnu/usr.bin/grep/grep.c +++ b/gnu/usr.bin/grep/grep.c @@ -1359,16 +1359,16 @@ main (int argc, char **argv) if (program_name && strrchr (program_name, '/')) program_name = strrchr (program_name, '/') + 1; + if (program_name[0] == 'b' && program_name[1] == 'z') { + BZflag = 1; + program_name += 2; + } #if HAVE_LIBZ > 0 - if (program_name[0] == 'z') { + else if (program_name[0] == 'z') { Zflag = 1; ++program_name; } #endif - if (program_name[0] == 'b') { - BZflag = 1; - ++program_name; - } #if defined(__MSDOS__) || defined(_WIN32) /* DOS and MS-Windows use backslashes as directory separators, and usually