Swap windows path chars in FILENAME_RESOLVER::ResolvePath

This fixes the QA for issue13591 falsely passing on Linux.
It is actually failing this entire time.

But there is more wtfery going on, such as wxFFile::IsOpened returning True on a directory path.


(cherry picked from commit 157180e77202107dd4f040dcc29ff910cca908c0)

Co-authored-by: Marek Roszko <mark.roszko@gmail.com>
This commit is contained in:
Mark Roszko 2025-05-07 00:13:20 +00:00
parent 6151a94f4e
commit 6eecfaf64e

View File

@ -257,6 +257,11 @@ wxString FILENAME_RESOLVER::ResolvePath( const wxString& aFileName, const wxStri
// first attempt to use the name as specified:
wxString tname = aFileName;
// Swap separators for non-Windows, in case a Windows path is being passed
#ifndef __WIN32__
tname.Replace( "\\", "/" );
#endif
// Note: variable expansion must preferably be performed via a threadsafe wrapper for the
// getenv() system call. If we allow the wxFileName::Normalize() routine to perform expansion
// then we will have a race condition since wxWidgets does not assure a threadsafe wrapper