Skip to content

Commit fee3796

Browse files
pks-tgitster
authored andcommitted
builtin/config: pull out function to handle --null
Pull out function to handle the `--null` option, which we are about to reuse in subsequent commits. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9dda6b7 commit fee3796

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

builtin/config.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,14 @@ static void handle_config_location(const char *prefix)
698698
}
699699
}
700700

701+
static void handle_nul(void) {
702+
if (end_nul) {
703+
term = '\0';
704+
delim = '\n';
705+
key_delim = '\n';
706+
}
707+
}
708+
701709
static struct option builtin_config_options[] = {
702710
OPT_GROUP(N_("Config file location")),
703711
OPT_BOOL(0, "global", &use_global_config, N_("use global config file")),
@@ -760,12 +768,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
760768
PARSE_OPT_STOP_AT_NON_OPTION);
761769

762770
handle_config_location(prefix);
763-
764-
if (end_nul) {
765-
term = '\0';
766-
delim = '\n';
767-
key_delim = '\n';
768-
}
771+
handle_nul();
769772

770773
if ((actions & (ACTION_GET_COLOR|ACTION_GET_COLORBOOL)) && type) {
771774
error(_("--get-color and variable type are incoherent"));

0 commit comments

Comments
 (0)