aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author"Vladimir N. Oleynik" <dzo@simtreas.ru>2005-09-23 13:50:24 +0000
committer"Vladimir N. Oleynik" <dzo@simtreas.ru>2005-09-23 13:50:24 +0000
commitbf4497406f4eb67e57e3bfaa3ef98c8811104847 (patch)
treeb1fcc3c0b8f6cf8adf8a82787a29c781e1c79973
parentc96b703ab08bfa61be4b8a1c034405576ead53ac (diff)
downloadbusybox-w32-bf4497406f4eb67e57e3bfaa3ef98c8811104847.tar.gz
busybox-w32-bf4497406f4eb67e57e3bfaa3ef98c8811104847.tar.bz2
busybox-w32-bf4497406f4eb67e57e3bfaa3ef98c8811104847.zip
SUSv3 -q compatibily exit status correction for grep again
-rw-r--r--findutils/grep.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index 986804553..e41f1a3be 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -398,7 +398,9 @@ extern int grep_main(int argc, char **argv)
398 } 398 }
399#endif 399#endif
400 400
401 if(be_quiet) 401 if(be_quiet && matched)
402 return error_open_count ? 2 : 0; 402 return 0;
403 if(error_open_count)
404 return 2;
403 return !matched; /* invert return value 0 = success, 1 = failed */ 405 return !matched; /* invert return value 0 = success, 1 = failed */
404} 406}