From 39eb46763bae8336eee44ecd5cdb5aef998beb40 Mon Sep 17 00:00:00 2001 From: Mete Durlu Date: Tue, 21 Jul 2026 10:10:44 +0200 Subject: [PATCH] zmemtopo: Remove false leading/trailing space trimming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove all util_strstrip() calls. The current users are command line option stripping and partition name stripping. Keep user passed arguments as is, typical shells already remove leading and trailing whitespace unless explicitly quoted. Spaces in partition names are valid. Keep the leading/trailing spaces to preserve user given partition names. Reviewed-by: Jan Höppner Signed-off-by: Mete Durlu Signed-off-by: Steffen Eiden --- zmemtopo/zmemtopo.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/zmemtopo/zmemtopo.c b/zmemtopo/zmemtopo.c index 1f51caeb..8855d15c 100644 --- a/zmemtopo/zmemtopo.c +++ b/zmemtopo/zmemtopo.c @@ -62,15 +62,11 @@ static void parse_nesting_level(char *arg) static void parse_sort_field(char *arg) { - char *s; - - s = util_strdup(arg); - util_strstrip(s); - if (strcasecmp(s, "nr") == 0) + if (strcasecmp(arg, "nr") == 0) g.sort_field = SORT_NR; - else if (strcasecmp(s, "lpar") == 0) + else if (strcasecmp(arg, "lpar") == 0) g.sort_field = SORT_NAME; - else if (strcasecmp(s, "size") == 0) + else if (strcasecmp(arg, "size") == 0) g.sort_field = SORT_SIZE; else errx(EXIT_FAILURE, "%s is not a valid sort field option", arg); @@ -313,7 +309,6 @@ static void topology_entries_add_entry(struct topology_entry *entry, static void partition_set_name(struct partition *part, char *pname) { ebcdic_to_ascii(pname, part->part_name, LPAR_NAME_LEN); - util_strstrip(part->part_name); } static void partition_add_entry(struct partition *part,