Skip to content

Commit 4da5beb

Browse files
benknoblegitster
authored andcommitted
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>
1 parent 2fd151a commit 4da5beb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

parse-options.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ static enum parse_opt_result do_get_value(struct parse_opt_ctx_t *p,
208208
case OPTION_FILENAME:
209209
{
210210
const char *value;
211-
int is_optional;
211+
bool is_optional;
212212

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

225225
is_optional = skip_prefix(value, ":(optional)", &value);
226226
if (!value)
227-
is_optional = 0;
227+
is_optional = false;
228228
value = fix_filename(p->prefix, value);
229229
if (is_optional && is_missing_file(value)) {
230230
free((char *)value);

0 commit comments

Comments
 (0)