Blame SOURCES/cscope-3-Avoid-putting-directories-found-during-header-search.patch

565b65
From f693474b85f8dc1d31570833c62d9210ed1ffcf2 Mon Sep 17 00:00:00 2001
565b65
From: mikhail nefedov <mnefedov@users.sourceforge.net>
565b65
Date: Thu, 23 Aug 2018 00:36:52 +0200
565b65
Subject: [PATCH 4/9] Avoid putting directories found during header search into
565b65
 srcfiles.
565b65
565b65
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
565b65
---
565b65
 src/dir.c | 7 +++++--
565b65
 1 file changed, 5 insertions(+), 2 deletions(-)
565b65
565b65
diff --git a/src/dir.c b/src/dir.c
565b65
index 01c599e..7f7287e 100644
565b65
--- a/src/dir.c
565b65
+++ b/src/dir.c
565b65
@@ -616,8 +616,11 @@ incfile(char *file, char *type)
565b65
 	    snprintf(path, sizeof(path), "%.*s/%s",
565b65
 		    (int)(PATHLEN - 2 - file_len), incdirs[i],
565b65
 		    file);
565b65
-	    if (access(compath(path), READ) == 0) {
565b65
-		addsrcfile(path);
565b65
+            if (access(compath(path), READ) == 0) {
565b65
+                struct stat st;
565b65
+                if( 0 == stat(path,&st) && S_ISREG(st.st_mode) ) {
565b65
+                     addsrcfile(path);
565b65
+                }
565b65
 		break;
565b65
 	    }
565b65
 	}
565b65
-- 
565b65
2.26.2
565b65