remove trailing spaces in demo footer (#456)

This commit is contained in:
Roman Fomin 2022-02-21 15:32:17 +07:00 committed by GitHub
parent d22b631a10
commit 4a2e5a899d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 12 deletions

View File

@ -1627,7 +1627,7 @@ void ProcessDehFile(const char *filename, char *outfilename, int lumpnum)
printf("-deh file %s not found\n",filename);
return; // should be checked up front anyway
}
tmp = M_StringJoin("\"", M_BaseName(filename), "\" ", NULL);
tmp = M_StringJoin(" \"", M_BaseName(filename), "\"", NULL);
M_StringAdd(&dehfiles, tmp);
(free)(tmp);
infile.lump = NULL;

View File

@ -3306,40 +3306,36 @@ static void G_AddDemoFooter(void)
int i;
str = M_StringJoin(PROJECT_STRING, DEMO_FOOTER_SEPARATOR,
"-iwad \"", M_BaseName(wadfiles[0]), "\" ", NULL);
"-iwad \"", M_BaseName(wadfiles[0]), "\"", NULL);
for (i = 1; wadfiles[i]; i++)
{
if (i == 1)
M_StringAdd(&str, "-file ");
M_StringAdd(&str, " -file");
tmp = M_StringJoin("\"", M_BaseName(wadfiles[i]), "\" ", NULL);
tmp = M_StringJoin(" \"", M_BaseName(wadfiles[i]), "\"", NULL);
M_StringAdd(&str, tmp);
(free)(tmp);
}
if (dehfiles)
{
M_StringAdd(&str, "-deh ");
M_StringAdd(&str, " -deh");
M_StringAdd(&str, dehfiles);
}
if (demo_compatibility)
{
M_StringAdd(&str, "-complevel vanilla ");
tmp = M_StringJoin("-gameversion ", GetGameVersionCmdline(), " ", NULL);
M_StringAdd(&str, " -complevel vanilla");
tmp = M_StringJoin(" -gameversion ", GetGameVersionCmdline(), NULL);
M_StringAdd(&str, tmp);
(free)(tmp);
}
if (coop_spawns)
{
M_StringAdd(&str, "-coop_spawns");
M_StringAdd(&str, " -coop_spawns");
}
tmp = str + strlen(str) - 1;
while (*tmp == ' ')
*tmp-- = '\0';
M_StringAdd(&str, DEMO_FOOTER_SEPARATOR);
len = strlen(str);