From: Max Kellermann Date: Fri, 8 Nov 2013 18:35:04 +0000 (+0100) Subject: conf: eliminate local variable "match_found" X-Git-Tag: v0.22~19 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=422a778ecee46225d139d512fe99768d670a9c0e;p=ncmpc.git conf: eliminate local variable "match_found" --- diff --git a/src/conf.c b/src/conf.c index f9b6918..0166f6f 100644 --- a/src/conf.c +++ b/src/conf.c @@ -378,7 +378,6 @@ parse_line(char *line) size_t len = strlen(line), i = 0, j = 0; char name[MAX_LINE_LENGTH]; char value[MAX_LINE_LENGTH]; - bool match_found; /* get the name part */ while (i < len && line[i] != '=' && !g_ascii_isspace(line[i])) @@ -396,8 +395,6 @@ parse_line(char *line) value[j++] = line[i++]; value[j] = '\0'; - match_found = true; - /* key definition */ if (!strcasecmp(CONF_KEY_DEFINITION, name)) parse_key_definition(value); @@ -557,13 +554,12 @@ parse_line(char *line) #else options.second_column = str2bool(value); #endif - else - match_found = false; - - if (!match_found) + else { print_error(_("Unknown configuration parameter"), name); + return false; + } - return match_found; + return true; } static int