Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mac crash on subdirs #286

Merged
merged 1 commit into from
Jan 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix mac crash on subdirs
file::extension on a file or path with no extension behaved
improperly. Correct it. Stops crash at startup with subdirs.
  • Loading branch information
baconpaul committed Jan 12, 2019
commit f6891f4c590618867910c4bcfc1d6471b7c82638
3 changes: 3 additions & 0 deletions libs/filesystem/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ namespace std::experimental::filesystem {

path path::extension() {
auto idx = this->p.find_last_of(".");
if( idx == std::string::npos )
return path( "" );

path res(p.substr(idx));
return res;
}
Expand Down