Fail loading the playlist on errors mid-file. The same code is used for
playlistadd, playlistdelete, etc. and would've caused the playlist to be rewritten only up to the line with the error. git-svn-id: https://svn.musicpd.org/mpd/trunk@6133 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
a2a101004b
commit
92ff09881a
@ -192,6 +192,8 @@ StoredPlaylist *loadStoredPlaylist(const char *utf8path, int fd)
|
||||
|
||||
ERROR("\"%s\" too long", temp);
|
||||
free(temp);
|
||||
freeStoredPlaylist(sp);
|
||||
sp = NULL;
|
||||
goto out;
|
||||
}
|
||||
free(temp);
|
||||
@ -211,6 +213,8 @@ StoredPlaylist *loadStoredPlaylist(const char *utf8path, int fd)
|
||||
s, utf8path);
|
||||
}
|
||||
ERROR("line \"%s\" in playlist \"%s\" is too long\n", s, utf8path);
|
||||
freeStoredPlaylist(sp);
|
||||
sp = NULL;
|
||||
goto out;
|
||||
} else if (s[slength] != '\r')
|
||||
slength++;
|
||||
|
Loading…
Reference in New Issue
Block a user