Commit c0f2024a authored by Max Kellermann's avatar Max Kellermann

exclude: make variables more local

parent 28f3e190
...@@ -34,13 +34,9 @@ ...@@ -34,13 +34,9 @@
GSList * GSList *
exclude_list_load(const char *path_fs) exclude_list_load(const char *path_fs)
{ {
FILE *file;
char line[1024];
GSList *list = NULL;
assert(path_fs != NULL); assert(path_fs != NULL);
file = fopen(path_fs, "r"); FILE *file = fopen(path_fs, "r");
if (file == NULL) { if (file == NULL) {
if (errno != ENOENT) { if (errno != ENOENT) {
char *path_utf8 = fs_charset_to_utf8(path_fs); char *path_utf8 = fs_charset_to_utf8(path_fs);
...@@ -52,6 +48,8 @@ exclude_list_load(const char *path_fs) ...@@ -52,6 +48,8 @@ exclude_list_load(const char *path_fs)
return NULL; return NULL;
} }
GSList *list = NULL;
char line[1024];
while (fgets(line, sizeof(line), file) != NULL) { while (fgets(line, sizeof(line), file) != NULL) {
char *p = strchr(line, '#'); char *p = strchr(line, '#');
if (p != NULL) if (p != NULL)
......
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