aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2005-10-20 21:50:44 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2005-10-20 21:50:44 +0000
commit354cdde5b97d5f030e14e222f339d2a34ae87b8a (patch)
treefc54545f79099a03f80db93088d2106f571fa01c
parent64a266f9e8b5fc5da3d37e249ee8ed99f4058857 (diff)
Notes
-rw-r--r--gnu/usr.bin/grep/grep.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gnu/usr.bin/grep/grep.c b/gnu/usr.bin/grep/grep.c
index 04a1667204201..ca47a49cb46b1 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 (strlen (program_name) > 1 && program_name[0] == 'b' && program_name[1] == 'z') {
+ BZflag = 1;
+ program_name += 2;
+ }
#if HAVE_LIBZ > 0
- if (program_name[0] == 'z') {
+ else if (strlen (program_name) > 0 && 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