Fix warning: multi-line comment [-Wcomment] use :341,355s/: \zs.*/\=string(submatch(0))

This commit is contained in:
George Zhao
2018-01-17 20:03:01 +08:00
parent 2408a05151
commit e76c6e2ee8

View File

@@ -339,20 +339,20 @@ static void quote_cmd_arg(char *dest, size_t dest_remaining, const char *src)
} }
// Expected input/output: // Expected input/output:
// input : hello"world // input : 'hello"world'
// output: "hello\"world" // output: '"hello\"world"'
// input : hello""world // input : 'hello""world'
// output: "hello\"\"world" // output: '"hello\"\"world"'
// input : hello\world // input : 'hello\world'
// output: hello\world // output: 'hello\world'
// input : hello\\world // input : 'hello\\world'
// output: hello\\world // output: 'hello\\world'
// input : hello\"world // input : 'hello\"world'
// output: "hello\\\"world" // output: '"hello\\\"world"'
// input : hello\\"world // input : 'hello\\"world'
// output: "hello\\\\\"world" // output: '"hello\\\\\"world"'
// input : hello world\ // input : 'hello world\'
// output: "hello world\\" // output: '"hello world\\"'
assert(dest_remaining--); assert(dest_remaining--);
*(dest++) = NUL; *(dest++) = NUL;