From aea1726f45735a6768884a3f49f8f5ffcf2337e2 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sun, 10 Mar 2019 16:52:13 +0100 Subject: 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. --- src/strgen/strgen.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index 80fe49a48..11e6b8dbd 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -392,11 +392,13 @@ static inline char *mkpath(char *buf, const char *last, const char *path, const return buf; } -#if defined(__MINGW32__) +#if defined(_WIN32) /** * On MingW, it is common that both / as \ are accepted in the * 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) { -- cgit v1.2.3-54-g00ecf