Commit 4ab80020 authored by jan.koester's avatar jan.koester
Browse files

test

parent 9d5c058a
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -110,7 +110,16 @@ void confplus::Yaml::saveConfig(const char *path, const Config *conf){
    };

    auto quoteValue = [&needsQuote](const std::string &s) -> std::string {
        if (needsQuote(s)) return "\"" + s + "\"";
        if (needsQuote(s)) {
            std::string out;
            out.reserve(s.size() + 2);
            for (char c : s) {
                if (c == '\\') out += "\\\\";
                else if (c == '"') out += "\\\"";
                else out += c;
            }
            return "\"" + out + "\"";
        }
        return s;
    };