mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
2fd151af13
commit
4da5bebc17
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user