]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Chat: escape '\' characters
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 6 Apr 2018 10:01:50 +0000 (20:01 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 6 Apr 2018 10:01:50 +0000 (20:01 +1000)
qcsrc/lib/cvar.qh

index 3822805b930b4576905de2370712587fae2fa425..19b48ee3e6a2f2d0358fc6d1d7b81a55afee0b2a 100644 (file)
@@ -34,6 +34,7 @@ ERASEABLE
 string console_encode(string input)
 {
        input = strreplace("$", "$$", input);
+       input = strreplace("\\", "\\\\", input);
        input = strreplace("\r", "\\r", input);
        input = strreplace("\n", "\\n", input);
        input = strreplace("\"", "\\\"", input);
@@ -48,6 +49,7 @@ string console_decode(string input)
        input = strreplace("\\r", "\r", input);
        input = strreplace("\\n", "\n", input);
        input = strreplace("\\\"", "\"", input);
+       input = strreplace("\\\\", "\\", input);
        return input;
 }