Save-state: undo the backslash-doubling so that UI only shows single slashes. (#1510)

This commit is contained in:
tomcw committed 2026-09-27 18:57:13 +01:00
1 parent 540635176e
commit faafd21dc8
1 file changed
+15
+15
View File
@@ -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;
}