summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a0e8155)
raw | patch | inline | side by side (parent: a0e8155)
author | Max Kellermann <max@duempel.org> | |
Tue, 29 Sep 2009 20:35:55 +0000 (22:35 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Tue, 29 Sep 2009 20:35:55 +0000 (22:35 +0200) |
src/screen_play.c | patch | blob | history |
diff --git a/src/screen_play.c b/src/screen_play.c
index 6872b139110b9e9741001351d7d0a1842e3868bb..fbabe10714bc9a04084b6385afd10778bb14e0d5 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
filename_utf8 = locale_to_utf8(filename);
error = mpdclient_cmd_save_playlist(c, filename_utf8);
- g_free(filename_utf8);
if (error) {
gint code = GET_ACK_ERROR_CODE(error);
buf));
g_free(buf);
- if (key == YES[0]) {
- filename_utf8 = locale_to_utf8(filename);
- error = mpdclient_cmd_delete_playlist(c, filename_utf8);
+ if (key != YES[0]) {
g_free(filename_utf8);
+ g_free(filename);
+ screen_status_printf(_("Aborted"));
+ return -1;
+ }
- if (error) {
- g_free(filename);
- return -1;
- }
+ error = mpdclient_cmd_delete_playlist(c, filename_utf8);
+ if (error) {
+ g_free(filename_utf8);
+ g_free(filename);
+ return -1;
+ }
- error = playlist_save(c, filename, NULL);
+ error = mpdclient_cmd_save_playlist(c, filename_utf8);
+ if (error) {
+ g_free(filename_utf8);
g_free(filename);
return error;
}
-
- screen_status_printf(_("Aborted"));
+ } else {
+ g_free(filename_utf8);
+ g_free(filename);
+ return -1;
}
-
- g_free(filename);
- return -1;
}
+ g_free(filename_utf8);
+
/* success */
screen_status_printf(_("Saved %s"), filename);
g_free(filename);