We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd997e5 commit 1a8a34dCopy full SHA for 1a8a34d
1 file changed
src/util/path.cc
@@ -9,7 +9,7 @@
9
#include <sys/stat.h>
10
#include <sys/types.h>
11
#include <cstring>
12
-
+#include <libgen.h>
13
#include "path.h"
14
15
#ifdef __MINGW32__
@@ -114,12 +114,18 @@ bool is_truetype_suffix(const string & suffix)
114
115
string get_filename (const string & path)
116
{
117
+ char* s= basename(strdup(path.c_str()));
118
+ std::string str(s);
119
+ return str;
120
+
121
+ /*
122
size_t idx = path.rfind('/');
123
if(idx == string::npos)
124
return path;
125
else if (idx == path.size() - 1)
126
return "";
127
return path.substr(idx + 1);
128
+ */
129
}
130
131
string get_suffix(const string & path)
0 commit comments