Skip to content

Commit

Permalink
quote PWAD file names in response file (#2057)
Browse files Browse the repository at this point in the history
Fixes #2048
fabiangreffrath authored Nov 28, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent e48e8c2 commit 34b1291
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup/multiplayer.c
Original file line number Diff line number Diff line change
@@ -136,7 +136,7 @@ static void AddWADs(execute_context_t *exec)
have_wads = 1;
}

AddCmdLineParameter(exec, "%s", wads[i]);
AddCmdLineParameter(exec, "\"%s\"", wads[i]);
}
}
}
15 changes: 14 additions & 1 deletion src/d_main.c
Original file line number Diff line number Diff line change
@@ -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')))

0 comments on commit 34b1291

Please sign in to comment.