diff options
Diffstat (limited to 'src')
-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; + } } } |