Changeset - r23458:e40bbeca908c
[Not reviewed]
master
0 1 0
Patric Stout - 5 years ago 2019-03-10 15:52:13
truebrain@openttd.org
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.
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/strgen/strgen.cpp
Show inline comments
 
@@ -392,11 +392,13 @@ static inline char *mkpath(char *buf, co
 
	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)
 
{
0 comments (0 inline, 0 general)