]> andersk Git - splint.git/blobdiff - src/cpplib.c
Incorporated path for file inclusion in cpplib.c.
[splint.git] / src / cpplib.c
index 82bbdd65a94a332f04fa5f47050e35c87e67fbab..40ac023b668adcca2b2b9fb48988bc48c42f0d7c 100644 (file)
@@ -8451,8 +8451,27 @@ static bool cpp_skipIncludeFile (cstring fname)
       
       if (context_getFlag (FLG_SKIPSYSHEADERS))
        {
-         DPRINTF (("Skip include TRUE: %s", fname));
-         return TRUE;
+         /*
+         ** 2003-04-18: Patch from Randal Parsons
+         */
+
+         /*
+         ** Don't skip include file unless the file actually exists.  
+         ** It may be in a different directory.
+         */
+
+         int f = open (cstring_toCharsSafe (fname), O_RDONLY, 0666);
+
+         if (f >= 0)
+           {
+             check (close (f) == 0);
+             DPRINTF (("Skip include TRUE: %s", fname));
+             return TRUE;
+           }
+         else
+           {
+             /* Keep looking... */
+           }
        }
     }
 
This page took 0.062813 seconds and 4 git commands to generate.