Remove quotes from argument value only if there is qoute on both sides. Signed-off-by: Michal Suchanek <msuchanek@xxxxxxx> --- lib/cmdline.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/cmdline.c b/lib/cmdline.c index 171c19b6888e..6d398a8b63fc 100644 --- a/lib/cmdline.c +++ b/lib/cmdline.c @@ -227,14 +227,12 @@ char *next_arg(char *args, char **param, char **val) *val = args + equals + 1; /* Don't include quotes in value. */ - if (**val == '"') { - (*val)++; - if (args[i-1] == '"') - args[i-1] = '\0'; + if ((args[i-1] == '"') && ((quoted) || (**val == '"'))) { + args[i-1] = '\0'; + if (!quoted) + (*val)++; } } - if (quoted && args[i-1] == '"') - args[i-1] = '\0'; if (args[i]) { args[i] = '\0'; -- 2.10.2 -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html