mirror of
https://github.com/AppleWin/AppleWin.git
synced 2026-10-25 14:03:18 +00:00
Save-state: undo the backslash-doubling so that UI only shows single slashes. (#1510)
This commit is contained in:
1 parent
540635176e
commit
faafd21dc8
1 file changed
+15
@@ -367,6 +367,21 @@ bool YamlLoadHelper::LoadBool(const std::string key)
|
||||
std::string YamlLoadHelper::LoadString_NoThrow(const std::string& key, bool& bFound)
|
||||
{
|
||||
std::string value = m_yamlHelper.GetMapValue(*m_pMapYaml, key, bFound);
|
||||
|
||||
if (bFound)
|
||||
{
|
||||
// Undo any backslash-doubling from a previous save-state, so that UI only shows single-backslashes (GH#1510)
|
||||
if (value.find("\\\\") != std::string::npos) // String contains a double backslash?
|
||||
{
|
||||
size_t pos = 0;
|
||||
while ((pos = value.find("\\\\", pos)) != std::string::npos)
|
||||
{
|
||||
value = value.replace(pos, 2, "\\");
|
||||
pos += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user