Received: by 10.223.164.202 with SMTP id h10csp753890wrb; Wed, 15 Nov 2017 07:22:56 -0800 (PST) X-Google-Smtp-Source: AGs4zMbetG9Tv7/FjUf/QFzmeuTrMdEF05cPI2bpsIHFGW629ERIvE8ZCpfURvkfAGz2lE6nqv+8 X-Received: by 10.98.137.68 with SMTP id v65mr17915672pfd.170.1510759376051; Wed, 15 Nov 2017 07:22:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510759376; cv=none; d=google.com; s=arc-20160816; b=PNTjmBL5P0/k2kQV/AsUUjhS3bPAWIEcVSV29tQhwRDlcDt+8Mal4/LAgIUo2m6Tao OmlU5hAdbengXfUHxyjgfTw7VEHRU9Y9hmQBSOeaLVUHwTWiL/zKwz73LZ/rZRO97NFt IOPR42HjhkfBk54VfYlE6WR7KdzzWKVNqH82KCxaZqQ7DV+3KLYWDM8fqpwTmFsDMN8Y fd/FWTLO4I5MuCRe2hGa8EWrUSGsxCNcephxJqQOuk6CR9vSYjewVck/Op3D5zRkgx3i ZWz3PD+kWctv9exnMI7dLgCk0RdSsfaiEZtHA/bAGrbyOMyhyvM6AfXFGPOd+EqnBc5n wt4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:date:cc:to:from :subject:arc-authentication-results; bh=eN2KXcBhSGZ/29qsTYjxnH42EOeZ8q7w7iGs2kOYzDg=; b=wbZaHN8T3auSQid0bqsYTLkBFxWMUGpAI3QeeJhI5Pv/MDPCKQ59KrdFdN/4HGXgub mAg9VKlSrnlbjTmYhj7Ig0iVq1eiUxeFGUK+NwXRGaZNGvvhMVyLnFRfPVQVMGIEAmMI 43Sx0E8xQt1sVS0p3dAXzN5jS13DLHZUgn5qOHBhOEDBqIvOfOrLyPkEdQUY9CU/1KLI YodEcYfTdCn3qrYpqwSL13T1IlkLxqPpCNkTuHI1+ce+NxrDhhdI8/tFEAkw3okCO1st umlXV3hOgu35QUveJWyRll2MWOdtNWFLqYjlZpqk61sxuLqWQUXa9iYp2MF4QA+WbTLj VJ3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w19si19638962pfa.59.2017.11.15.07.22.43; Wed, 15 Nov 2017 07:22:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758517AbdKOPRO (ORCPT + 89 others); Wed, 15 Nov 2017 10:17:14 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:34216 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758496AbdKOPRH (ORCPT ); Wed, 15 Nov 2017 10:17:07 -0500 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAFFGcGs040420 for ; Wed, 15 Nov 2017 10:17:07 -0500 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2e8m8tmaqr-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 15 Nov 2017 10:17:06 -0500 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 15 Nov 2017 15:17:03 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 15 Nov 2017 15:17:00 -0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vAFFH0M237355586; Wed, 15 Nov 2017 15:17:00 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E70544C05C; Wed, 15 Nov 2017 15:12:13 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A12654C04A; Wed, 15 Nov 2017 15:12:11 +0000 (GMT) Received: from hbathini.in.ibm.com (unknown [9.79.199.182]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 15 Nov 2017 15:12:11 +0000 (GMT) Subject: [PATCH v9 1/8] lib/cmdline.c: remove quotes symmetrically From: Hari Bathini To: linuxppc-dev , Andrew Morton , lkml Cc: Michael Ellerman , Ankit Kumar , Michal =?utf-8?b?U3VjaMOhbmVr?= , Mahesh J Salgaonkar Date: Wed, 15 Nov 2017 20:46:56 +0530 In-Reply-To: <151075897205.14434.9005256552409420263.stgit@hbathini.in.ibm.com> References: <151075897205.14434.9005256552409420263.stgit@hbathini.in.ibm.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17111515-0016-0000-0000-00000501A6C7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17111515-0017-0000-0000-0000283D6219 Message-Id: <151075900967.14434.2860376398321506569.stgit@hbathini.in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-15_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711150206 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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'; From 1584100086110193330@xxx Wed Nov 15 03:12:46 +0000 2017 X-GM-THRID: 1584098729596927351 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread