diff options
Diffstat (limited to 'src/main/java/org/anarres/cpp/Preprocessor.java')
-rw-r--r-- | src/main/java/org/anarres/cpp/Preprocessor.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/org/anarres/cpp/Preprocessor.java b/src/main/java/org/anarres/cpp/Preprocessor.java index 8b1ddcc..5dacc91 100644 --- a/src/main/java/org/anarres/cpp/Preprocessor.java +++ b/src/main/java/org/anarres/cpp/Preprocessor.java @@ -1150,6 +1150,16 @@ public class Preprocessor implements Closeable { @Nonnull String name, boolean quoted, boolean next) throws IOException, LexerException { + if (name.startsWith("/")) { + VirtualFile file = filesystem.getFile(name); + if (include(file)) + return; + StringBuilder buf = new StringBuilder(); + buf.append("File not found: ").append(name); + error(line, 0, buf.toString()); + return; + } + VirtualFile pdir = null; if (quoted) { if (parent != null) { |