diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 4622a65ea..1aef41fee 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -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 { diff --git a/src/ta-utils.h b/src/ta-utils.h index a1e2441c1..53b1e4a8c 100644 --- a/src/ta-utils.h +++ b/src/ta-utils.h @@ -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))