Skip to content

Commit 26df3c5

Browse files
committed
Merge pull request coolwanglu#555: fix windows path issue
2 parents e51ed48 + 1a8a34d commit 26df3c5

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

ChangeLog

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

22
* Processed pull requests #444-683 from nov14 to sep16:
3-
#693: Reactivated ctest in simplified form
4-
#444 rejected (won't compile)
5-
#446 rejected (won't compile)
6-
#493 rejected (not clear this is the right way to deal with illegal Unicode)
7-
3+
#693 reactivate ctest in simplified form
4+
#555 fix windows path issue
5+
* Rejected the following old pull requests:
6+
#444 won't compile
7+
#446 won't compile
8+
#493 not clear this is the right way to deal with illegal Unicode
89

910
v0.14.6
1011
2015.07.22

src/util/path.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <sys/stat.h>
1010
#include <sys/types.h>
1111
#include <cstring>
12-
12+
#include <libgen.h>
1313
#include "path.h"
1414

1515
#ifdef __MINGW32__
@@ -114,12 +114,18 @@ bool is_truetype_suffix(const string & suffix)
114114

115115
string get_filename (const string & path)
116116
{
117+
char* s= basename(strdup(path.c_str()));
118+
std::string str(s);
119+
return str;
120+
121+
/*
117122
size_t idx = path.rfind('/');
118123
if(idx == string::npos)
119124
return path;
120125
else if (idx == path.size() - 1)
121126
return "";
122127
return path.substr(idx + 1);
128+
*/
123129
}
124130

125131
string get_suffix(const string & path)

0 commit comments

Comments
 (0)