From: Max Kellermann Date: Tue, 29 Sep 2009 16:20:33 +0000 (+0200) Subject: main: don't skip "{}" in server error message X-Git-Tag: release-0.16~316 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e5b513acb6274a9670685da2254bfe1f6a894974;p=ncmpc.git 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. --- 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