Skip to content

Commit 201a20a

Browse files
committed
system(): allow win32 paths on linux builds
1 parent 44fb2ab commit 201a20a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/wow.h

+21
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,28 @@ wow_system(char const *path)
580580

581581
return rval;
582582
#else /* not win32 unicode */
583+
#ifdef _WIN32
583584
return system(path);
585+
#else
586+
// allow win32 paths on linux builds
587+
if (strchr(path, '\\'))
588+
{
589+
char *tmp = strdup(path);
590+
int rval;
591+
592+
for (char *c = tmp; *c; ++c)
593+
if (*c == '\\')
594+
*c = '/';
595+
596+
rval = system(tmp);
597+
free(tmp);
598+
return rval;
599+
}
600+
else
601+
{
602+
return system(path);
603+
}
604+
#endif
584605
#endif
585606
}
586607

0 commit comments

Comments
 (0)