[PATCH:makedepend 1/2] Bug 28045 - makedepend fails on directory named like an include file

Alan Coopersmith alan.coopersmith at oracle.com
Fri May 14 21:23:29 PDT 2010


From: Martin Pärtel <lagitus at mbnet.fi>

<https://bugs.freedesktop.org/show_bug.cgi?id=28045>

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 include.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include.c b/include.c
index e40c26c..0a4ad2a 100644
--- a/include.c
+++ b/include.c
@@ -264,7 +264,7 @@ inc_path(const char *file, const char *include, int type)
 		if ((type == INCLUDEDOT) ||
 		    (type == INCLUDENEXTDOT) ||
 		    (*include == '/')) {
-			if (stat(include, &st) == 0)
+			if (stat(include, &st) == 0 && !S_ISDIR(st.st_mode))
 				return newinclude(include, include);
 			if (show_where_not)
 				warning1("\tnot in %s\n", include);
@@ -286,7 +286,7 @@ inc_path(const char *file, const char *include, int type)
 				strcpy(path + (p-file) + 1, include);
 			}
 			remove_dotdot(path);
-			if (stat(path, &st) == 0)
+			if (stat(path, &st) == 0 && !S_ISDIR(st.st_mode))
 				return newinclude(path, include);
 			if (show_where_not)
 				warning1("\tnot in %s\n", path);
@@ -304,7 +304,7 @@ inc_path(const char *file, const char *include, int type)
 	for (; *pp; pp++) {
 		sprintf(path, "%s/%s", *pp, include);
 		remove_dotdot(path);
-		if (stat(path, &st) == 0) {
+		if (stat(path, &st) == 0 && !S_ISDIR(st.st_mode)) {
 			includedirsnext = pp + 1;
 			return newinclude(path, include);
 		}
-- 
1.5.6.5



More information about the xorg-devel mailing list