From: Jeffrey Middleton Date: Wed, 25 Mar 2009 15:46:32 +0000 (-0500) Subject: conf: screen-list fix, removed unused option X-Git-Tag: release-0.14~48 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=edef608c0fdf384bae52f220f4a58027d0c5385f;p=ncmpc.git conf: screen-list fix, removed unused option screen-list produced errors due to empty fields between multiple consecutive delimiters. Check to make sure the field is nonempty before attempting to parse it. enable-bell is not used at all (it has been replaced by audible- and visible-bell). --- diff --git a/src/conf.c b/src/conf.c index 1dc1a43..1d6d1b8 100644 --- a/src/conf.c +++ b/src/conf.c @@ -43,7 +43,6 @@ #define CONF_ENABLE_COLORS "enable-colors" #define CONF_AUTO_CENTER "auto-center" #define CONF_WIDE_CURSOR "wide-cursor" -#define CONF_ENABLE_BELL "enable-bell" #define CONF_KEY_DEFINITION "key" #define CONF_COLOR "color" #define CONF_COLOR_DEFINITION "colordef" @@ -303,15 +302,17 @@ check_screen_list(char *value) j=0; while( tmp && tmp[i] ) { char *name = g_ascii_strdown(tmp[i], -1); - if (screen_lookup_name(name) == NULL) { - /* an unknown screen name was specified in the - configuration file */ - print_error(_("Unknown screen name"), name); - free(name); - } else { - screen = g_realloc(screen, (j+2)*sizeof(char *)); - screen[j++] = name; - screen[j] = NULL; + if (*name != '\0') { + if (screen_lookup_name(name) == NULL) { + /* an unknown screen name was specified in the + configuration file */ + print_error(_("Unknown screen name"), name); + free(name); + } else { + screen = g_realloc(screen, (j+2)*sizeof(char *)); + screen[j++] = name; + screen[j] = NULL; + } } i++; }