Skip to content

Commit

Permalink
fix(dracut-install): do not fail when SOURCE is optional and missing
Browse files Browse the repository at this point in the history
When running dracut-install with '-o' (optional source), and nullglob
at the same time, when all of the arguments evaluate <null>, dracut-install
should not fail even when the source is not specified.
  • Loading branch information
pvalena authored and johannbg committed Apr 4, 2022
1 parent 36aaa74 commit bd1a5ca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/install/dracut-install.c
Original file line number Diff line number Diff line change
Expand Up @@ -1175,8 +1175,12 @@ static int parse_argv(int argc, char *argv[])
}

if (!optind || optind == argc) {
log_error("No SOURCE argument given");
usage(EXIT_FAILURE);
if (!arg_optional) {
log_error("No SOURCE argument given");
usage(EXIT_FAILURE);
} else {
exit(EXIT_SUCCESS);
}
}

return 1;
Expand Down

0 comments on commit bd1a5ca

Please sign in to comment.