Commit 8f40c029 authored by Marko Mäkelä's avatar Marko Mäkelä

Fix -Wmaybe-uninitialized

Follow-up to commit 8965ae27:
always initialize found_group.
parent 541b00a3
...@@ -605,7 +605,7 @@ static int search_default_file_with_ext(struct handle_option_ctx *ctx, ...@@ -605,7 +605,7 @@ static int search_default_file_with_ext(struct handle_option_ctx *ctx,
const int max_recursion_level= 10; const int max_recursion_level= 10;
MYSQL_FILE *fp; MYSQL_FILE *fp;
uint line=0; uint line=0;
enum { SKIP, PARSE, NONE } found_group; enum { NONE, PARSE, SKIP } found_group= NONE;
uint i; uint i;
MY_DIR *search_dir; MY_DIR *search_dir;
FILEINFO *search_file; FILEINFO *search_file;
...@@ -749,15 +749,18 @@ static int search_default_file_with_ext(struct handle_option_ctx *ctx, ...@@ -749,15 +749,18 @@ static int search_default_file_with_ext(struct handle_option_ctx *ctx,
? PARSE : SKIP; ? PARSE : SKIP;
continue; continue;
} }
if (found_group == NONE) switch (found_group)
{ {
case NONE:
fprintf(stderr, fprintf(stderr,
"error: Found option without preceding group in config file: %s at line: %d\n", "error: Found option without preceding group in config file: %s at line: %d\n",
name,line); name,line);
goto err; goto err;
} case PARSE:
if (found_group == SKIP) break;
case SKIP:
continue; continue;
}
end= remove_end_comment(ptr); end= remove_end_comment(ptr);
if ((value= strchr(ptr, '='))) if ((value= strchr(ptr, '=')))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment