SongSave: make variables more local

This commit is contained in:
Max Kellermann 2014-01-08 23:10:24 +01:00
parent 67a6a12916
commit 10406c73b3

View File

@ -60,15 +60,13 @@ song_load(TextFile &file, Directory *parent, const char *uri,
Song *song = parent != nullptr Song *song = parent != nullptr
? Song::NewFile(uri, parent) ? Song::NewFile(uri, parent)
: Song::NewRemote(uri); : Song::NewRemote(uri);
char *line, *colon;
TagType type;
const char *value;
TagBuilder tag; TagBuilder tag;
char *line;
while ((line = file.ReadLine()) != nullptr && while ((line = file.ReadLine()) != nullptr &&
strcmp(line, SONG_END) != 0) { strcmp(line, SONG_END) != 0) {
colon = strchr(line, ':'); char *colon = strchr(line, ':');
if (colon == nullptr || colon == line) { if (colon == nullptr || colon == line) {
song->Free(); song->Free();
@ -78,8 +76,9 @@ song_load(TextFile &file, Directory *parent, const char *uri,
} }
*colon++ = 0; *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) { if ((type = tag_name_parse(line)) != TAG_NUM_OF_ITEM_TYPES) {
tag.AddItem(type, value); tag.AddItem(type, value);
} else if (strcmp(line, "Time") == 0) { } else if (strcmp(line, "Time") == 0) {