- Fixed the wrong handling of empty command line argument.

This commit is contained in:
Edoardo Prezioso 2016-11-28 00:25:43 +01:00 committed by Christoph Oelckers
parent 5396e8d07d
commit 815a440014

View file

@ -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;