Skip to content

Commit bd1a5ca

Browse files
pvalenajohannbg
authored andcommitted
fix(dracut-install): do not fail when SOURCE is optional and missing
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.
1 parent 36aaa74 commit bd1a5ca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/install/dracut-install.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -1175,8 +1175,12 @@ static int parse_argv(int argc, char *argv[])
11751175
}
11761176

11771177
if (!optind || optind == argc) {
1178-
log_error("No SOURCE argument given");
1179-
usage(EXIT_FAILURE);
1178+
if (!arg_optional) {
1179+
log_error("No SOURCE argument given");
1180+
usage(EXIT_FAILURE);
1181+
} else {
1182+
exit(EXIT_SUCCESS);
1183+
}
11801184
}
11811185

11821186
return 1;

0 commit comments

Comments
 (0)