From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756148AbdLOUv1 (ORCPT ); Fri, 15 Dec 2017 15:51:27 -0500 Received: from mx2.suse.de ([195.135.220.15]:57423 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755596AbdLOUvX (ORCPT ); Fri, 15 Dec 2017 15:51:23 -0500 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> Organization: SUSE Linux X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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