From 3c2da3cf2ec205d135b2581eff58a66d53781a4c Mon Sep 17 00:00:00 2001 From: Jeremy517 Date: Mon, 10 Aug 2015 00:02:44 -0700 Subject: [PATCH] Fix ROM Browser for network shares This part of cleanPathString was supposed to de-dupe backslashes in the directory name, and then insert a backslash to the start of directory if the directory originally started with \\ (so that the string again started with \\). However, because the call to rDirectory.replace was specifying a length of 1, it was always replacing \ with \ instead of replacing \\ with \. When the backslash was then inserted at the start of the directory, the directory string now began with \\\ instead of \\. This broke the ROM browser when using a network share (such as \\myserver\Emulation\Games). --- Source/Common/path.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Common/path.cpp b/Source/Common/path.cpp index 578db233b..94e1c41d1 100644 --- a/Source/Common/path.cpp +++ b/Source/Common/path.cpp @@ -1022,7 +1022,7 @@ void CPath::cleanPathString(stdstr& rDirectory) const pos = rDirectory.find( DIR_DOUBLEDELIM ); while ( pos != std::string::npos ) { - rDirectory.replace( pos, 1, &DIRECTORY_DELIMITER ); + rDirectory.replace( pos, 2, &DIRECTORY_DELIMITER ); pos = rDirectory.find( DIR_DOUBLEDELIM, pos + 1 ); } if (AppendEnd)