projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c96b703
)
SUSv3 -q compatibily exit status correction for grep again
author
"Vladimir N. Oleynik"
<dzo@simtreas.ru>
Fri, 23 Sep 2005 13:50:24 +0000
(13:50 -0000)
committer
"Vladimir N. Oleynik"
<dzo@simtreas.ru>
Fri, 23 Sep 2005 13:50:24 +0000
(13:50 -0000)
findutils/grep.c
patch
|
blob
|
history
diff --git
a/findutils/grep.c
b/findutils/grep.c
index 986804553451fb775096227e862b9cbeeaa850c4..e41f1a3be46e54fef943c2b50d7c37de8e847c55 100644
(file)
--- a/
findutils/grep.c
+++ b/
findutils/grep.c
@@
-398,7
+398,9
@@
extern int grep_main(int argc, char **argv)
}
#endif
- if(be_quiet)
- return error_open_count ? 2 : 0;
+ if(be_quiet && matched)
+ return 0;
+ if(error_open_count)
+ return 2;
return !matched; /* invert return value 0 = success, 1 = failed */
}