mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-11 16:54:42 +00:00
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:
parent
45fbaa64c2
commit
aea1726f45
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user