bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/4] grep: exit with nonzero status if directory loop


From: Paul Eggert
Subject: [PATCH 3/4] grep: exit with nonzero status if directory loop
Date: Fri, 20 Jan 2012 23:07:38 -0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111124 Thunderbird/8.0

* src/main.c (grepdir): Exit with status 2 if a directory loop is
found, since the output might not be "right" (i.e., infinite...).
---
 src/main.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/main.c b/src/main.c
index 893f025..84564e0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1382,6 +1382,7 @@ grepdir (char const *dir, struct stats const *stats)
               if (!suppress_errors)
                 error (0, 0, _("warning: %s: %s"), dir,
                        _("recursive directory loop"));
+              errseen = 1;
               return 1;
             }
         }
-- 
1.7.6.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]