portablectl: no need to validate profile name before checking whether it is 'help'

This commit is contained in:
Lennart Poettering 2018-05-31 12:06:37 +02:00
parent f524522bde
commit b3c66c4497

View file

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