Skip to content

Commit

Permalink
On Windows we allow forward or backslash.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Mar 4, 2019
1 parent 0e29106 commit 9fd717a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pdal/util/FileUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,13 @@ std::string toAbsolutePath(const std::string& filename, const std::string base)

std::string getFilename(const std::string& path)
{
std::string::size_type pos = path.find_last_of(Utils::dirSeparator);
#ifdef _WIN32
std::string pathsep("\\/");
#else
char pathsep = Utils::dirSeparator;
#endif

std::string::size_type pos = path.find_last_of(pathsep);
if (pos == std::string::npos)
return path;
return path.substr(pos + 1);
Expand Down

0 comments on commit 9fd717a

Please sign in to comment.