Return-Path: Received: from ozlabs.org (bilbo.ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3yz2f5458YzDqhd for ; Sat, 16 Dec 2017 07:51:25 +1100 (AEDT) Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by bilbo.ozlabs.org (Postfix) with ESMTP id 3yz2f5389Zz8tMk for ; Sat, 16 Dec 2017 07:51:25 +1100 (AEDT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yz2f46PNcz9sCZ for ; Sat, 16 Dec 2017 07:51:24 +1100 (AEDT) Date: Fri, 15 Dec 2017 21:51:21 +0100 From: Michal =?UTF-8?B?U3VjaMOhbmVr?= To: Hari Bathini Cc: linuxppc-dev , Andrew Morton , lkml , Michael Ellerman , Ankit Kumar , Mahesh J Salgaonkar Subject: Re: [PATCH v9 1/8] lib/cmdline.c: remove quotes symmetrically Message-ID: <20171215215121.0560e669@kitsune.suse.cz> In-Reply-To: <151075900967.14434.2860376398321506569.stgit@hbathini.in.ibm.com> References: <151075897205.14434.9005256552409420263.stgit@hbathini.in.ibm.com> <151075900967.14434.2860376398321506569.stgit@hbathini.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 15 Nov 2017 20:46:56 +0530 Hari Bathini wrote: > From: Michal Suchanek > > Remove quotes from argument value only if there is qoute on both > sides. > > Signed-off-by: Michal Suchanek > --- > lib/cmdline.c | 10 ++++------ > 1 file changed, 4 insertions(+), 6 deletions(-) > > diff --git a/lib/cmdline.c b/lib/cmdline.c > index 171c19b..6d398a8 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'; > This was only useful as separate patch with the incremental fadump update. Since the fadump update is squashed in this refresh series this can be squashed with the following lib/cmdline patch as well. Thanks Michal