Skip to content

Commit

Permalink
nall: Resolve all file paths passed on command line
Browse files Browse the repository at this point in the history
  • Loading branch information
jcm93 committed Feb 12, 2025
1 parent 4fc0943 commit a1c04fb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nall/arguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ inline auto Arguments::construct() -> void {

//normalize path and file arguments
for(auto& argument : arguments) {
if(directory::exists(argument)) argument.transform("\\", "/").trimRight("/").append("/");
else if(file::exists(argument)) argument.transform("\\", "/").trimRight("/");
if(directory::exists(argument)) {
argument.transform("\\", "/").trimRight("/").append("/");
argument = Path::real(argument);
}
else if(file::exists(argument)) {
argument.transform("\\", "/").trimRight("/");
argument = {Path::real(argument), Location::file(argument)};
}
}
}

Expand Down

0 comments on commit a1c04fb

Please sign in to comment.