do pathseperator check like this

This commit is contained in:
Alug committed 2025-04-11 14:24:29 +02:00
1 parent 1ebebb5690
commit f1bcdaf68f
1 file changed
+8 -3
+8 -3
View File
@@ -6797,6 +6797,12 @@ void G_LoadDemoInfo(menudemo_t *pdemo)
#include <time.h>
#include <locale.h>
#if defined (_WIN32)
#define PATHSEPSTR '\\'
#else
#define PATHSEPSTR '/'
#endif
static char *G_GetDemoDate(menudemo_t *pdemo)
{
char *datetime;
@@ -6812,9 +6818,7 @@ static char *G_GetDemoDate(menudemo_t *pdemo)
// get the actual filename Zzz...
const char *filename;
filename = strrchr(pdemo->filepath, '/');
if (!filename)
filename = strrchr(pdemo->filepath, '\\');
filename = strrchr(pdemo->filepath, PATHSEPSTR);
if (!filename)
{
@@ -6858,6 +6862,7 @@ static char *G_GetDemoDate(menudemo_t *pdemo)
return datetime;
}
#undef PATHSEPSTR
void G_LoadDemoTitle(menudemo_t *pdemo)
{