aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-05-09 21:48:31 +0200
committerMax Kellermann <max@duempel.org>2011-05-09 21:48:31 +0200
commit5d06236acb3f4b4420d825c8931b5b7447d845c4 (patch)
tree21095b7c3a0b9c1d96b1086eb1dc1664a86f7c6d
parentd4b00ff11cf102d8982ef342371acfa16ed2e515 (diff)
downloadmpd-5d06236acb3f4b4420d825c8931b5b7447d845c4.tar.gz
mpd-5d06236acb3f4b4420d825c8931b5b7447d845c4.tar.xz
mpd-5d06236acb3f4b4420d825c8931b5b7447d845c4.zip
directory_save: fix assertion failure on space-only directory namev0.15.x
-rw-r--r--NEWS1
-rw-r--r--src/directory_save.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index a6deae06a..afdd66c49 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ ver 0.15.17 (2011/??/??)
- vorbis: reset the Ogg stream after flush
* decoders:
- vorbis: fix tremor support
+* database: fix assertion failure on space-only directory name
ver 0.15.16 (2011/03/13)
diff --git a/src/directory_save.c b/src/directory_save.c
index 132508447..d768a36c8 100644
--- a/src/directory_save.c
+++ b/src/directory_save.c
@@ -126,6 +126,14 @@ directory_load(FILE *fp, struct directory *directory, GError **error)
return false;
}
+ if (*name == 0)
+ /* workaround: a base name that
+ consists only of spaces is cleared
+ by g_strchomp(), and that may cause
+ an assertion failure in
+ directory_new() */
+ continue;
+
subdir = directory_get_child(directory, name);
if (subdir != NULL) {
assert(subdir->parent == directory);