Skip to content

Commit

Permalink
Fix #328 Current Directory not appending
Browse files Browse the repository at this point in the history
Fixes Issue #328, where current directory isn't appended when run from
lst file.

Signed-of-by Christopher Wu<christopher.wu@nxp.com>
  • Loading branch information
chriswu86459 committed Jul 22, 2022
1 parent 9569f6c commit 0a13d1c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions libuuu/buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1599,11 +1599,19 @@ bool check_file_exist(string filename, bool start_async_load)
{
string_ex fn;
fn += remove_quota(filename);
fn.replace('\\', '/');
string_ex path;
if (!fn.empty() && fn[0] != MAGIC_PATH)
{
if (fn == "..")
path += g_current_dir.substr(0, g_current_dir.size() - 1);
else
path += g_current_dir + fn;
}
path.replace('\\', '/');

if (fn.empty())
fn += "./";
return g_fs_data.exist(fn);
if (path.empty())
path += "./";
return g_fs_data.exist(path);
}

#ifdef WIN32
Expand Down

0 comments on commit 0a13d1c

Please sign in to comment.