Skip to content

Commit

Permalink
Merge pull request coolwanglu#555: fix windows path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jwuttke committed Sep 29, 2016
2 parents e51ed48 + 1a8a34d commit 26df3c5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 6 additions & 5 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

* Processed pull requests #444-683 from nov14 to sep16:
#693: Reactivated ctest in simplified form
#444 rejected (won't compile)
#446 rejected (won't compile)
#493 rejected (not clear this is the right way to deal with illegal Unicode)

#693 reactivate ctest in simplified form
#555 fix windows path issue
* Rejected the following old pull requests:
#444 won't compile
#446 won't compile
#493 not clear this is the right way to deal with illegal Unicode

v0.14.6
2015.07.22
Expand Down
8 changes: 7 additions & 1 deletion src/util/path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <cstring>

#include <libgen.h>
#include "path.h"

#ifdef __MINGW32__
Expand Down Expand Up @@ -114,12 +114,18 @@ bool is_truetype_suffix(const string & suffix)

string get_filename (const string & path)
{
char* s= basename(strdup(path.c_str()));
std::string str(s);
return str;

/*
size_t idx = path.rfind('/');
if(idx == string::npos)
return path;
else if (idx == path.size() - 1)
return "";
return path.substr(idx + 1);
*/
}

string get_suffix(const string & path)
Expand Down

0 comments on commit 26df3c5

Please sign in to comment.