From e5b513acb6274a9670685da2254bfe1f6a894974 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 29 Sep 2009 18:20:33 +0200 Subject: [PATCH] main: don't skip "{}" in server error message libmpdclient2 discards the command name from the error message, we don't need to do it again. --- src/main.c | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/src/main.c b/src/main.c index 398a46f..10706a5 100644 --- a/src/main.c +++ b/src/main.c @@ -66,39 +66,16 @@ static guint reconnect_source_id, update_source_id; static guint check_key_bindings_source_id; #endif -static const gchar * -error_msg(const gchar *msg) -{ - gchar *p; - - if ((p = strchr(msg, '}')) == NULL) - return msg; - - do { - p++; - } while (*p == '}' || * p== ' '); - - return p; -} - static void -error_callback(G_GNUC_UNUSED struct mpdclient *c, gint error, const gchar *_msg) +error_callback(G_GNUC_UNUSED struct mpdclient *c, G_GNUC_UNUSED gint error, + const gchar *_msg) { char *msg = utf8_to_locale(_msg); - - error = error & 0xFF; - switch (error) { - case MPD_ERROR_SERVER: - screen_status_printf("%s", error_msg(msg)); - screen_bell(); - break; - default: - screen_status_printf("%s", msg); - screen_bell(); - doupdate(); - } - + screen_status_printf("%s", msg); g_free(msg); + + screen_bell(); + doupdate(); } #ifndef NCMPC_MINI -- 2.30.2