Skip to content

Commit

Permalink
Made the ArgumentList::getAbsolutePath() strip quotes when parsing ar…
Browse files Browse the repository at this point in the history
…gs as filenames
  • Loading branch information
julianstorer committed Oct 7, 2024
1 parent b1fd114 commit 39beafe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions containers/choc_ArgumentList.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,11 @@ inline std::vector<std::filesystem::path> ArgumentList::getAllAsExistingFiles()

inline std::filesystem::path ArgumentList::getAbsolutePath (const std::filesystem::path& path)
{
auto s = path.string();

if (s.length() >= 2 && s[0] == '"' && s.back() == '"')
return getAbsolutePath (s.substr (1, s.length() - 2));

return path.is_absolute() ? path : std::filesystem::current_path() / path;
}

Expand Down

0 comments on commit 39beafe

Please sign in to comment.