Skip to content

Commit

Permalink
show original path in include errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yeti0904 committed Jul 26, 2024
1 parent da751ed commit 5f042b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/preprocessor.d
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Preprocessor {
auto path = format("%s/%s", dirName(node.error.file), node.path);

if (!exists(path)) {
auto oldPath = path;
bool found;

foreach (ref ipath ; includeDirs) {
Expand All @@ -47,7 +48,10 @@ class Preprocessor {

if (!found) {
ErrorBegin(node.error);
stderr.writefln("Can't find file '%s'", node.path);
stderr.writefln(
"Can't find file '%s', tried '%s' and in include paths",
node.path, oldPath
);
exit(1);
}
}
Expand Down

0 comments on commit 5f042b7

Please sign in to comment.