summaryrefslogtreecommitdiff
path: root/src/lexer.l
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-02-04 01:40:46 (GMT)
committerMarius Kintel <marius@kintel.net>2012-02-15 00:32:37 (GMT)
commitcaa6272fe8e96aa713f4e4d243f78d8b271991bb (patch)
tree3a82303c4a44f5d5d8dee3f2ae2b2d9a561180ec /src/lexer.l
parentb9d218e13760f21be5aa94c15631d63b29439e18 (diff)
Don't try to handle non-existing use'd libraries
Diffstat (limited to 'src/lexer.l')
-rw-r--r--src/lexer.l9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lexer.l b/src/lexer.l
index 11f2aff..5e24e7f 100644
--- a/src/lexer.l
+++ b/src/lexer.l
@@ -120,9 +120,12 @@ use[ \t\r\n>]*"<" { BEGIN(cond_use); }
usepath = boosty::absolute(fs::path(get_librarydir()) / filename);
}
}
- handle_dep(usepath.string());
- parserlval.text = strdup(usepath.string().c_str());
- return TOK_USE;
+ /* Only accept regular files which exists */
+ if (usepath.has_parent_path() && fs::exists(usepath)) {
+ handle_dep(usepath.string());
+ parserlval.text = strdup(usepath.string().c_str());
+ return TOK_USE;
+ }
}
}
contact: Jan Huwald // Impressum