diff options
-rw-r--r-- | src/lexer.l | 1 | ||||
-rw-r--r-- | testdata/scad/include-test.scad | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/lexer.l b/src/lexer.l index 9e8aaf8..932711b 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -202,6 +202,7 @@ void includefile() yyin = fopen(finfo.absoluteFilePath().toLocal8Bit(), "r"); if (!yyin) { PRINTA("WARNING: Can't open input file `%1'.", filename); + path_stack.pop(); return; } filename.clear(); diff --git a/testdata/scad/include-test.scad b/testdata/scad/include-test.scad index a9528f5..5db02d7 100644 --- a/testdata/scad/include-test.scad +++ b/testdata/scad/include-test.scad @@ -1,6 +1,9 @@ //Test that the entire path is pushed onto the stack upto the last '/' include <sub1/sub2/sub3/sub4/include-test2.scad> +//Test that a non existent path/file doesn't screw things up +include <non/existent/path/non-file> + //Test with empty path include <include-test5.scad> |