svn commit: trunk/busybox/findutils

vodz at busybox.net vodz at busybox.net
Fri Sep 23 13:44:05 UTC 2005


Author: vodz
Date: 2005-09-23 06:44:03 -0700 (Fri, 23 Sep 2005)
New Revision: 11592

Log:
SUSv3 -q compatibily exit status correction for grep

Modified:
   trunk/busybox/findutils/grep.c


Changeset:
Modified: trunk/busybox/findutils/grep.c
===================================================================
--- trunk/busybox/findutils/grep.c	2005-09-23 13:23:15 UTC (rev 11591)
+++ trunk/busybox/findutils/grep.c	2005-09-23 13:44:03 UTC (rev 11592)
@@ -376,7 +376,7 @@
 			if (file == NULL) {
 				if (!suppress_err_msgs)
 					bb_perror_msg("%s", cur_file);
-			error_open_count++;
+				error_open_count++;
 		} else {
 			matched += grep_file(file);
 			if(matched < 0) {
@@ -398,7 +398,7 @@
 	}
 #endif
 
-	if(error_open_count)
-		return 2;
+	if(be_quiet)
+		return error_open_count ? 2 : 0;
 	return !matched; /* invert return value 0 = success, 1 = failed */
 }




More information about the busybox-cvs mailing list