mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Fix the replay menu for people with non-latin characters in their username.
Use OsPath instead of CStr and CStrW where possible,
wstring_from_utf8(OsPath.string8()) to pass printable strings to the
JSAPI,
OsString when opening a filestream and
off_t instead of int for filesizes.
Fixes #4320
Differential Revision: https://code.wildfiregames.com/D518
Reviewed By: Imarok
Tested By: Imarok on Windows, wraitii on OSX
Special thanks to Philip for advice and the lib/path.h fix in
47cc447322.
This was SVN commit r19824.
This commit is contained in:
+6
-6
@@ -467,20 +467,20 @@ static void RunGameOrAtlas(int argc, const char* argv[])
|
||||
const bool isNonVisualReplay = args.Has("replay");
|
||||
const bool isNonVisual = args.Has("autostart-nonvisual");
|
||||
|
||||
const CStr replayFile =
|
||||
const OsPath replayFile(
|
||||
isVisualReplay ? args.Get("replay-visual") :
|
||||
isNonVisualReplay ? args.Get("replay") : "";
|
||||
isNonVisualReplay ? args.Get("replay") : "");
|
||||
|
||||
if (isVisualReplay || isNonVisualReplay)
|
||||
{
|
||||
if (!FileExists(OsPath(replayFile)))
|
||||
if (!FileExists(replayFile))
|
||||
{
|
||||
debug_printf("ERROR: The requested replay file '%s' does not exist!\n", replayFile.c_str());
|
||||
debug_printf("ERROR: The requested replay file '%s' does not exist!\n", replayFile.string8().c_str());
|
||||
return;
|
||||
}
|
||||
if (DirectoryExists(OsPath(replayFile)))
|
||||
if (DirectoryExists(replayFile))
|
||||
{
|
||||
debug_printf("ERROR: The requested replay file '%s' is a directory!\n", replayFile.c_str());
|
||||
debug_printf("ERROR: The requested replay file '%s' is a directory!\n", replayFile.string8().c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user