Skip to content

Commit

Permalink
Deal with trailing slashes in file paths
Browse files Browse the repository at this point in the history
Happens in bash completion on BP files since they are folders.
  • Loading branch information
franzpoeschel committed Jul 7, 2023
1 parent c09d9bc commit 2dd2e4e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Series.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,11 @@ std::unique_ptr<Series::ParsedInput> Series::parseInput(std::string filepath)
filepath = auxiliary::replace_all(filepath, "\\", "/");
}
#endif
if (auxiliary::ends_with(filepath, auxiliary::directory_separator))
{
filepath = auxiliary::replace_last(
filepath, std::string(&auxiliary::directory_separator, 1), "");
}
auto const pos = filepath.find_last_of(auxiliary::directory_separator);
if (std::string::npos == pos)
{
Expand Down

0 comments on commit 2dd2e4e

Please sign in to comment.