diff options
author | Max Kellermann <max@duempel.org> | 2014-01-08 23:10:24 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-08 23:10:24 +0100 |
commit | 10406c73b385c7f536cb737d87680e691a80b508 (patch) | |
tree | 43de8d9e92e046742ff9f45fb5d1cda1ae4a4784 /src | |
parent | 67a6a1291694c228f1a6341386d9b8e7645f4a47 (diff) | |
download | mpd-10406c73b385c7f536cb737d87680e691a80b508.tar.gz mpd-10406c73b385c7f536cb737d87680e691a80b508.tar.xz mpd-10406c73b385c7f536cb737d87680e691a80b508.zip |
SongSave: make variables more local
Diffstat (limited to '')
-rw-r--r-- | src/SongSave.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/SongSave.cxx b/src/SongSave.cxx index c2e3afce5..18ac63d12 100644 --- a/src/SongSave.cxx +++ b/src/SongSave.cxx @@ -60,15 +60,13 @@ song_load(TextFile &file, Directory *parent, const char *uri, Song *song = parent != nullptr ? Song::NewFile(uri, parent) : Song::NewRemote(uri); - char *line, *colon; - TagType type; - const char *value; TagBuilder tag; + char *line; while ((line = file.ReadLine()) != nullptr && strcmp(line, SONG_END) != 0) { - colon = strchr(line, ':'); + char *colon = strchr(line, ':'); if (colon == nullptr || colon == line) { song->Free(); @@ -78,8 +76,9 @@ song_load(TextFile &file, Directory *parent, const char *uri, } *colon++ = 0; - value = strchug_fast(colon); + const char *value = strchug_fast(colon); + TagType type; if ((type = tag_name_parse(line)) != TAG_NUM_OF_ITEM_TYPES) { tag.AddItem(type, value); } else if (strcmp(line, "Time") == 0) { |