From 815a44001463f7a988e571006f670132c7cdd569 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Mon, 28 Nov 2016 00:25:43 +0100 Subject: [PATCH] - Fixed the wrong handling of empty command line argument. --- src/c_dispatch.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index d112634d6a..296697ee76 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -1040,7 +1040,11 @@ FString BuildString (int argc, FString *argv) 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. buf << '"'; long substr_start = 0, quotepos;