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

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