aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShevek <[email protected]>2008-05-08 19:36:40 +0000
committerShevek <[email protected]>2008-05-08 19:36:40 +0000
commitd7362497e323ee1d2e94165f9642e4b9a663a542 (patch)
tree570bcfc5d5ff778671a014e02bf508b79c2f5df6
parente38a59d3a0c51ee5548ea070945cb18f9aef45a7 (diff)
more work towards 2.0
-rw-r--r--src/java/org/anarres/cpp/Preprocessor.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/java/org/anarres/cpp/Preprocessor.java b/src/java/org/anarres/cpp/Preprocessor.java
index b3b1169..59f8991 100644
--- a/src/java/org/anarres/cpp/Preprocessor.java
+++ b/src/java/org/anarres/cpp/Preprocessor.java
@@ -825,6 +825,7 @@ public class Preprocessor {
protected boolean include(File file)
throws IOException,
LexerException {
+ // System.out.println("Try to include " + file);
if (!file.exists())
return false;
if (!file.isFile())
@@ -856,7 +857,7 @@ public class Preprocessor {
throws IOException,
LexerException {
if (quoted) {
- File dir = parent.getParentFile();
+ File dir = parent.getAbsoluteFile().getParentFile();
if (dir == null)
dir = new File("/");
File file = new File(dir, name);
@@ -870,12 +871,14 @@ public class Preprocessor {
return;
StringBuilder buf = new StringBuilder();
- if (quoted)
+ if (quoted) {
+ buf.append(" .");
for (String dir : quoteincludepath)
buf.append(" ").append(dir);
+ }
for (String dir : sysincludepath)
buf.append(" ").append(dir);
- error(line, 0, "File not found: " + name + " in " + buf);
+ error(line, 0, "File not found: " + name + " in" + buf);
}
private Token include()