Commit 2b3f691c authored by Dino Bollinger's avatar Dino Bollinger Committed by Richard Gobeille
Browse files

Engine: findfrompath() with empty filename immediately returns -1

Fixes a bug where an empty filename is interpreted as the current
directory "./", which of course always exists.
parent fd9212c4
......@@ -282,6 +282,10 @@ int32_t findfrompath(const char *fn, char **where)
// pathsearchmode == 0: tests current dir and then the dirs of the path stack
// pathsearchmode == 1: tests fn without modification, then like for pathsearchmode == 0
// sanity check -- abort if filename is empty
if (!fn || !fn[0])
return -1;
if (pathsearchmode)
{
// test unmolested filename first
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment