Skip to content

Commit f21921d

Browse files
committed
Improve include paths analysis (for "" fall back into lib dir if needed).
1 parent ddeef4e commit f21921d

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

CxxDependencyVisualizer/Util.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,18 @@ public static string GetIncludePath(string dir, string path, string line)
164164
{
165165
string include = line.Substring(idBegin + 1, idEnd - idBegin - 1);
166166
include = include.Trim();
167-
string p = PathFromDirFile(closingChar == '>'
168-
? dir
169-
: DirFromPath(path),
170-
include);
167+
string p;
168+
if (closingChar == '>')
169+
{
170+
p = PathFromDirFile(dir, include);
171+
}
172+
else
173+
{
174+
p = PathFromDirFile(DirFromPath(path), include);
175+
if (!File.Exists(p))
176+
p = PathFromDirFile(dir, include);
177+
}
178+
171179
return p;
172180
}
173181
}

0 commit comments

Comments
 (0)