mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 06:12:19 +00:00
- Fixed the wrong handling of empty command line argument.
This commit is contained in:
parent
5396e8d07d
commit
815a440014
1 changed files with 5 additions and 1 deletions
|
@ -1040,7 +1040,11 @@ FString BuildString (int argc, FString *argv)
|
||||||
|
|
||||||
for (arg = 0; arg < argc; arg++)
|
for (arg = 0; arg < argc; arg++)
|
||||||
{
|
{
|
||||||
if (strchr(argv[arg], '"'))
|
if (argv[arg][0] == '\0')
|
||||||
|
{ // It's an empty argument, we need to convert it to '""'
|
||||||
|
buf << "\"\" ";
|
||||||
|
}
|
||||||
|
else if (strchr(argv[arg], '"'))
|
||||||
{ // If it contains one or more quotes, we need to escape them.
|
{ // If it contains one or more quotes, we need to escape them.
|
||||||
buf << '"';
|
buf << '"';
|
||||||
long substr_start = 0, quotepos;
|
long substr_start = 0, quotepos;
|
||||||
|
|
Loading…
Reference in a new issue