quote PWAD file names in response file (#2057)

Fixes #2048
This commit is contained in:
Fabian Greffrath 2024-11-28 10:28:39 +01:00 committed by GitHub
parent e48e8c2cb8
commit 34b1291dff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 2 deletions

View File

@ -136,7 +136,7 @@ static void AddWADs(execute_context_t *exec)
have_wads = 1;
}
AddCmdLineParameter(exec, "%s", wads[i]);
AddCmdLineParameter(exec, "\"%s\"", wads[i]);
}
}
}

View File

@ -1101,10 +1101,23 @@ void FindResponseFile (void)
indexinfile++; // SKIP PAST ARGV[0] (KEEP IT)
do
{
boolean quote = false;
if (infile[k] == '"')
{
quote = true;
k++;
}
myargv[indexinfile++] = infile+k;
while(k < size &&
((*(infile+k)>= ' '+1) && (*(infile+k)<='z')))
((*(infile+k)>= ' ') && (*(infile+k)<='z')))
{
if ((!quote && infile[k] == ' ') ||
(quote && infile[k] == '"'))
{
break;
}
k++;
}
*(infile+k) = 0;
while(k < size &&
((*(infile+k)<= ' ') || (*(infile+k)>'z')))