Skip to content

Commit

Permalink
Fixed broken \(on some OS like Windows 10 etc.\) versions system
Browse files Browse the repository at this point in the history
  • Loading branch information
ddroom committed Aug 9, 2015
1 parent 6ec1122 commit 4f008e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

1.0.0.1 - Fixed broken (on some OS like Windows 10 etc.) versions system.

6 changes: 4 additions & 2 deletions src/photo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ string Photo_t::file_name_from_photo_id(string photo_id) {
string file_name = photo_id;
const char *ptr = photo_id.c_str();
int i = photo_id.length();
// search for separator ':', but be aware of possible combination like 'C:\...:...' on windows platforms
for(; i > 0 && ptr[i] != CHAR_PHOTO_VERSION_SEPARATOR; i--);
if(i > 0)
file_name.erase(i, photo_id.length());
if(i > 0 && i != photo_id.length())
if(ptr[i + 1] != '\\' && ptr[i + 1] != '/')
file_name.erase(i, photo_id.length());
return file_name;
}

Expand Down

0 comments on commit 4f008e7

Please sign in to comment.