]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Replace tabs with an empty string when parsing settemp parameters, workaround for...
authorMario <mario.mario@y7mail.com>
Mon, 21 Jun 2021 12:16:24 +0000 (22:16 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 21 Jun 2021 12:16:24 +0000 (22:16 +1000)
qcsrc/common/mapinfo.qc

index facfe02b75c8b145180b8553947e0b77fbeea33d..c0b67ff4d535e97e9752132fafd7134c28c9ae6d 100644 (file)
@@ -627,7 +627,10 @@ string MapInfo_Type_ToText(Gametype t)
 void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s, float recurse)
 {
        string t;
-       float fh, o;
+       float o;
+       // tabs are invalid, treat them as "empty"
+       s = strreplace("\t", "", s);
+
        t = car(s); s = cdr(s);
 
        // limited support of "" and comments
@@ -661,7 +664,7 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
        {
                if(recurse > 0)
                {
-                       fh = fopen(s, FILE_READ);
+                       float fh = fopen(s, FILE_READ);
                        if(fh < 0)
                        {
                                if(WARN_COND)
@@ -671,6 +674,7 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
                        {
                                while((s = fgets(fh)))
                                {
+                                       s = strreplace("\t", "", s); // treat tabs as "empty", perform here first to ensure coments are detected
                                        // catch different sorts of comments
                                        if(s == "")                    // empty lines
                                                continue;