From b3c66c44970497c0100dd16fb6c6bc10853588c8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 31 May 2018 12:06:37 +0200 Subject: [PATCH] portablectl: no need to validate profile name before checking whether it is 'help' --- src/portable/portablectl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/portable/portablectl.c b/src/portable/portablectl.c index 04a261297c..4051875b76 100644 --- a/src/portable/portablectl.c +++ b/src/portable/portablectl.c @@ -884,14 +884,14 @@ static int parse_argv(int argc, char *argv[]) { break; case 'p': + if (streq(optarg, "help")) + return dump_profiles(); + if (!filename_is_valid(optarg)) { log_error("Unit profile name not valid: %s", optarg); return -EINVAL; } - if (streq(optarg, "help")) - return dump_profiles(); - arg_profile = optarg; break; -- 2.25.1