Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

fix windows path issue #555

Open
wants to merge 2 commits into
base: incoming
Choose a base branch
from
Open
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
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