parseopt: use boolean type for a simple flag

Suggested-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
main
D. Ben Knoble 2025-11-02 11:17:46 -05:00 committed by Junio C Hamano
parent 2fd151af13
commit 4da5bebc17
1 changed files with 2 additions and 2 deletions

View File

@ -208,7 +208,7 @@ static enum parse_opt_result do_get_value(struct parse_opt_ctx_t *p,
case OPTION_FILENAME:
{
const char *value;
int is_optional;
bool is_optional;

if (unset)
value = NULL;
@ -224,7 +224,7 @@ static enum parse_opt_result do_get_value(struct parse_opt_ctx_t *p,

is_optional = skip_prefix(value, ":(optional)", &value);
if (!value)
is_optional = 0;
is_optional = false;
value = fix_filename(p->prefix, value);
if (is_optional && is_missing_file(value)) {
free((char *)value);