From: Mario Date: Mon, 21 Jun 2021 12:16:24 +0000 (+1000) Subject: Replace tabs with an empty string when parsing settemp parameters, workaround for... X-Git-Tag: xonotic-v0.8.5~398 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a4c29b5282d887937c29ed834dee9fb3c392d734;p=xonotic%2Fxonotic-data.pk3dir.git Replace tabs with an empty string when parsing settemp parameters, workaround for #2333 --- diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index facfe02b7..c0b67ff4d 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -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;