diff options
author | Marius Kintel <marius@kintel.net> | 2012-02-04 01:40:46 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-02-15 00:32:37 (GMT) |
commit | caa6272fe8e96aa713f4e4d243f78d8b271991bb (patch) | |
tree | 3a82303c4a44f5d5d8dee3f2ae2b2d9a561180ec /src/lexer.l | |
parent | b9d218e13760f21be5aa94c15631d63b29439e18 (diff) |
Don't try to handle non-existing use'd libraries
Diffstat (limited to 'src/lexer.l')
-rw-r--r-- | src/lexer.l | 9 |
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; + } } } |