bug-grep
[Top][All Lists]
Advanced

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

Re: [PATCH] fix segfault with -R --exclude-dir on stdin


From: Allan McRae
Subject: Re: [PATCH] fix segfault with -R --exclude-dir on stdin
Date: Mon, 12 Mar 2012 11:33:52 +1000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120217 Thunderbird/10.0.2

I have just noticed the documented change in the -R behaviour and that
lead me to see the segfault occurs any time "-R --exclude-dir=" is used
without a file operand.   I think this is the correct fix.


>From 5632dd1c8a3438b45f2c48ea661507f7d4f8dbb0 Mon Sep 17 00:00:00 2001
From: Allan McRae <address@hidden>
Date: Mon, 12 Mar 2012 10:54:32 +1000
Subject: [PATCH] grep: fix segfault with -R --exclude-dir

* src/main.c: exclude files from current working directory if no file
operand is given.

Signed-off-by: Allan McRae <address@hidden>
---
 src/main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c
index 2f6c761..d1674fa 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1362,7 +1362,7 @@ grepdir (char const *dir, struct stats const *stats)
   char *name_space;
   int status = 1;
   if (excluded_directory_patterns
-      && excluded_file_name (excluded_directory_patterns, dir))
+      && excluded_file_name (excluded_directory_patterns, dir_or_dot))
     return 1;

   /* Mingw32 does not support st_ino.  No known working hosts use zero
-- 
1.7.9.3





reply via email to

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