fix improper dir sep when loading sample on Win

This commit is contained in:
tildearrow 2022-02-01 03:20:15 -05:00
parent f75803c3b2
commit df97142157
2 changed files with 7 additions and 1 deletions

View File

@ -4833,7 +4833,7 @@ bool DivEngine::addSampleFromFile(const char* path) {
sf_close(f);
DivSample* sample=new DivSample;
int sampleCount=(int)song.sample.size();
const char* sName=strrchr(path,'/');
const char* sName=strrchr(path,DIR_SEPARATOR);
if (sName==NULL) {
sName=path;
} else {

View File

@ -9,6 +9,12 @@
typedef SSIZE_T ssize_t;
#endif
#ifdef _WIN32
#define DIR_SEPARATOR '\\'
#else
#define DIR_SEPARATOR '/'
#endif
typedef std::string String;
#define MIN(a,b) (((a)<(b))?(a):(b))