From 78ccd8ae40d1379d19dec5dbf5a6e85d21cb1b31 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 18 Oct 2009 00:30:42 +0200 Subject: [PATCH] screen_browser: convert path only for the message We don't need the locale path if we don't print a message. --- src/screen_browser.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/screen_browser.c b/src/screen_browser.c index 455053c..8802e5f 100644 --- a/src/screen_browser.c +++ b/src/screen_browser.c @@ -122,16 +122,17 @@ static bool load_playlist(struct mpdclient *c, const struct mpd_playlist *playlist) { struct mpd_connection *connection = mpdclient_get_connection(c); - char *filename = utf8_to_locale(mpd_playlist_get_path(playlist)); if (mpd_run_load(connection, mpd_playlist_get_path(playlist))) { + char *filename = utf8_to_locale(mpd_playlist_get_path(playlist)); screen_status_printf(_("Loading playlist %s..."), g_basename(filename)); + g_free(filename); + c->events |= MPD_IDLE_QUEUE; } else mpdclient_handle_error(c); - g_free(filename); return true; } -- 2.30.2