summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pärtel <lagitus@mbnet.fi>2010-05-14 21:00:15 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2010-05-14 21:00:15 -0700
commit8522c314da7537169996476fe5ba411f720a09fe (patch)
tree04a247d7fe887ee2cb2d89c048e184a46e3a0414
parentc976a7fc7c21772c00de9e61178cf467c6a10b57 (diff)
Bug 28045 - makedepend fails on directory named like an include file
<https://bugs.freedesktop.org/show_bug.cgi?id=28045> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--include.c6
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);
}