lkml.org 
[lkml]   [2017]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v8 4/6] powerpc/fadump: update the dequoting logic to match lib/cmdline.c
Date
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
arch/powerpc/kernel/fadump.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 0e08f1a80af2..b214c1e333dd 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -501,10 +501,12 @@ static void __init fadump_update_params(struct param_info *param_info,
}

/* next_arg removes one leading and one trailing '"' */
- if (*(tgt + FADUMP_EXTRA_ARGS_LEN + 1) == '"')
- shortening += 1;
- if (*(tgt + FADUMP_EXTRA_ARGS_LEN + 1 + vallen + shortening) == '"')
+ if ((*(tgt + FADUMP_EXTRA_ARGS_LEN + 1 + vallen + shortening) == '"') &&
+ (quoted || (*(tgt + FADUMP_EXTRA_ARGS_LEN + 1) == '"'))) {
shortening += 1;
+ if (!quoted)
+ shortening += 1;
+ }

/* remove one leading and one trailing quote if both are present */
if ((val[0] == '"') && (val[vallen - 1] == '"')) {
--
2.10.2
\
 
 \ /
  Last update: 2017-09-12 18:03    [W:0.098 / U:1.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site