zmemtopo: Remove false leading/trailing space trimming

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 <hoeppner@linux.ibm.com>
Signed-off-by: Mete Durlu <meted@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Mete Durlu
2026-07-21 10:10:44 +02:00
committed by Steffen Eiden
parent ce1464ad5f
commit 39eb46763b

View File

@@ -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,