Code

conf: eliminate local variable "match_found"
authorMax Kellermann <max@duempel.org>
Fri, 8 Nov 2013 18:35:04 +0000 (19:35 +0100)
committerMax Kellermann <max@duempel.org>
Fri, 8 Nov 2013 18:35:04 +0000 (19:35 +0100)
src/conf.c

index f9b6918e3df70cce1ba7ac5d0f5e717c6f4328bf..0166f6fd6b6c18ddf8a82d713412d49612a2e01b 100644 (file)
@@ -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