Fix: MingW and MSVC compiled strgen had different path separator behaviour

If it was compiled with MingW, both / and \ were accepted as
path separator. On MSVC, only \ was. This is an unexpected
difference between binaries for the same platform. Remove this
discrepancy by accepting both / and \ on all platforms.
This commit is contained in:
Patric Stout 2019-03-10 16:52:13 +01:00
parent 45fbaa64c2
commit aea1726f45
1 changed files with 4 additions and 2 deletions

View File

@ -392,11 +392,13 @@ static inline char *mkpath(char *buf, const char *last, const char *path, const
return buf; return buf;
} }
#if defined(__MINGW32__) #if defined(_WIN32)
/** /**
* On MingW, it is common that both / as \ are accepted in the * On MingW, it is common that both / as \ are accepted in the
* params. To go with those flow, we rewrite all incoming / * params. To go with those flow, we rewrite all incoming /
* simply to \, so internally we can safely assume \. * simply to \, so internally we can safely assume \, and do
* this for all Windows machines to keep identical behaviour,
* no matter what your compiler was.
*/ */
static inline char *replace_pathsep(char *s) static inline char *replace_pathsep(char *s)
{ {