[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <151075900967.14434.2860376398321506569.stgit@hbathini.in.ibm.com>
Date: Wed, 15 Nov 2017 20:46:56 +0530
From: Hari Bathini <hbathini@...ux.vnet.ibm.com>
To: linuxppc-dev <linuxppc-dev@...abs.org>,
Andrew Morton <akpm@...ux-foundation.org>,
lkml <linux-kernel@...r.kernel.org>
Cc: Michael Ellerman <mpe@...erman.id.au>,
Ankit Kumar <ankit@...ux.vnet.ibm.com>,
Michal Suchánek <msuchanek@...e.de>,
Mahesh J Salgaonkar <mahesh@...ux.vnet.ibm.com>
Subject: [PATCH v9 1/8] lib/cmdline.c: remove quotes symmetrically
From: Michal Suchanek <msuchanek@...e.de>
Remove quotes from argument value only if there is qoute on both sides.
Signed-off-by: Michal Suchanek <msuchanek@...e.de>
---
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';
Powered by blists - more mailing lists