aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-06-19 19:31:14 +0000
committerKalle Wallin <kaw@linux.se>2004-06-19 19:31:14 +0000
commit60ba82303f21ccf5ee53e6e2a48ca3d4dee89acb (patch)
tree1fd639856df6facaffdbb3567e1ea317bb9c85f2 /src/main.c
parent0a40624443576a8929d9f2370d52248cab9245fe (diff)
downloadmpd-60ba82303f21ccf5ee53e6e2a48ca3d4dee89acb.tar.gz
mpd-60ba82303f21ccf5ee53e6e2a48ca3d4dee89acb.tar.xz
mpd-60ba82303f21ccf5ee53e6e2a48ca3d4dee89acb.zip
display errors without exiting when key bindings are broken
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1564 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/main.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c
index 81522f9d7..b48bd0091 100644
--- a/src/main.c
+++ b/src/main.c
@@ -34,6 +34,8 @@
#include "screen.h"
#include "conf.h"
+#define BUFSIZE 256
+
static mpdclient_t *mpd = NULL;
static gboolean connected = FALSE;
static GTimer *timer = NULL;
@@ -106,6 +108,7 @@ main(int argc, const char *argv[])
options_t *options;
struct sigaction act;
const char *charset = NULL;
+ gboolean key_error;
#ifdef HAVE_LOCALE_H
/* time and date formatting */
@@ -133,14 +136,10 @@ main(int argc, const char *argv[])
/* read configuration */
read_configuration(options);
-
- /* check key bindings */
- if( check_key_bindings() )
- {
- fprintf(stderr, _("Confusing key bindings - exiting!\n"));
- exit(EXIT_FAILURE);
- }
+ /* check key bindings */
+ key_error = check_key_bindings(NULL, 0);
+
/* parse command line options - 2 pass */
options_parse(argc, argv);
@@ -209,6 +208,14 @@ main(int argc, const char *argv[])
{
static gdouble t = G_MAXDOUBLE;
+ if( key_error )
+ {
+ char buf[BUFSIZE];
+
+ key_error=check_key_bindings(buf, BUFSIZE);
+ screen_status_printf("%s", buf);
+ }
+
if( connected && (t>=MPD_UPDATE_TIME || mpd->need_update) )
{
mpdclient_update(mpd);