Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[cascardo/linux.git] / scripts / kconfig / lxdialog / util.c
index ebc781b..a1bddef 100644 (file)
@@ -221,16 +221,14 @@ static void init_dialog_colors(void)
  */
 static void color_setup(const char *theme)
 {
-       if (set_theme(theme)) {
-               if (has_colors()) {     /* Terminal supports color? */
-                       start_color();
-                       init_dialog_colors();
-               }
-       }
-       else
-       {
+       int use_color;
+
+       use_color = set_theme(theme);
+       if (use_color && has_colors()) {
+               start_color();
+               init_dialog_colors();
+       } else
                set_mono_theme();
-       }
 }
 
 /*
@@ -274,6 +272,11 @@ void init_dialog(const char *backtitle)
        color_setup(getenv("MENUCONFIG_COLOR"));
 }
 
+void set_dialog_backtitle(const char *backtitle)
+{
+       dlg.backtitle = backtitle;
+}
+
 void reset_dialog(void)
 {
        initscr();              /* Init curses */
@@ -338,7 +341,7 @@ void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x)
                newl = 1;
                word = tempstr;
                while (word && *word) {
-                       sp = index(word, ' ');
+                       sp = strchr(word, ' ');
                        if (sp)
                                *sp++ = 0;
 
@@ -350,7 +353,7 @@ void print_autowrap(WINDOW * win, const char *prompt, int width, int y, int x)
                        if (wlen > room ||
                            (newl && wlen < 4 && sp
                             && wlen + 1 + strlen(sp) > room
-                            && (!(sp2 = index(sp, ' '))
+                            && (!(sp2 = strchr(sp, ' '))
                                 || wlen + 1 + (sp2 - sp) > room))) {
                                cur_y++;
                                cur_x = x;