Code

conf: screen-list fix, removed unused option
authorJeffrey Middleton <jefromi@gmail.com>
Wed, 25 Mar 2009 15:46:32 +0000 (10:46 -0500)
committerMax Kellermann <max@duempel.org>
Fri, 27 Mar 2009 07:25:10 +0000 (08:25 +0100)
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).

src/conf.c

index 1dc1a4333c9d99b918643854ca9b6ee5af083756..1d6d1b8f421dc79af4db923bb96ab6b5df450de6 100644 (file)
@@ -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++;
        }