process: adjust quote_cmd_arg for empty arguments
adjust quote_cmd_arg so that empty command line arguments are double quoted instead of skipped
This commit is contained in:
parent
85e17ca665
commit
907b55e4bf
@ -430,11 +430,10 @@ WCHAR* quote_cmd_arg(const WCHAR *source, WCHAR *target) {
|
||||
int quote_hit;
|
||||
WCHAR* start;
|
||||
|
||||
/*
|
||||
* Check if the string must be quoted;
|
||||
* if unnecessary, don't do it, it may only confuse older programs.
|
||||
*/
|
||||
if (len == 0) {
|
||||
/* Need double quotation for empty argument */
|
||||
*(target++) = L'"';
|
||||
*(target++) = L'"';
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
@ -808,6 +808,7 @@ WCHAR* quote_cmd_arg(const WCHAR *source, WCHAR *target);
|
||||
|
||||
TEST_IMPL(argument_escaping) {
|
||||
const WCHAR* test_str[] = {
|
||||
L"",
|
||||
L"HelloWorld",
|
||||
L"Hello World",
|
||||
L"Hello\"World",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user