aboutsummaryrefslogtreecommitdiffstats
path: root/src/exclude.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-03 10:01:48 +0100
committerMax Kellermann <max@duempel.org>2013-01-03 10:02:26 +0100
commitc0f2024a2eebaa156f3c9ddf55f58e00ce5cee8e (patch)
tree678162467462dde829471ebdb0db0956a8d8ebcd /src/exclude.c
parent28f3e190c8b13771a7fa37ee0a9c0833e792f35c (diff)
downloadmpd-c0f2024a2eebaa156f3c9ddf55f58e00ce5cee8e.tar.gz
mpd-c0f2024a2eebaa156f3c9ddf55f58e00ce5cee8e.tar.xz
mpd-c0f2024a2eebaa156f3c9ddf55f58e00ce5cee8e.zip
exclude: make variables more local
Diffstat (limited to '')
-rw-r--r--src/exclude.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/exclude.c b/src/exclude.c
index 438039d30..fecc859cb 100644
--- a/src/exclude.c
+++ b/src/exclude.c
@@ -34,13 +34,9 @@
GSList *
exclude_list_load(const char *path_fs)
{
- FILE *file;
- char line[1024];
- GSList *list = NULL;
-
assert(path_fs != NULL);
- file = fopen(path_fs, "r");
+ FILE *file = fopen(path_fs, "r");
if (file == NULL) {
if (errno != ENOENT) {
char *path_utf8 = fs_charset_to_utf8(path_fs);
@@ -52,6 +48,8 @@ exclude_list_load(const char *path_fs)
return NULL;
}
+ GSList *list = NULL;
+ char line[1024];
while (fgets(line, sizeof(line), file) != NULL) {
char *p = strchr(line, '#');
if (p != NULL)