kconfig/lxdialog: let <ESC><ESC> behave as expected

<ESC><ESC> is used to step one back in the dialogs.
When lxdialog became built-in pressing <ESC> once would cause one step back
and pressing <ESC><ESC> would cause two steps back.
This patch - based on concept from Roman Zippel <zippel@linux-m68k.org> -
makes one <ESC> a noop and pressing <ESC><ESC> will cause one step backward.

In addition the final yes/no dialog now has the option to go back to the
the kernel configuration. So if you get too far out you can now go back
to configuring the kernel without saving and starting all over again.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index b1ad9a0..ef75d6c 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -608,7 +608,7 @@
 				  _(menu_instructions),
 				  rows, cols, rows - 10,
 				  active_menu, &s_scroll);
-		if (res == 1 || res == 255)
+		if (res == 1 || res == KEY_ESC)
 			break;
 		if (!item_activate_selected())
 			continue;
@@ -754,7 +754,7 @@
 			} else
 				show_help(menu);
 			break;
-		case 255:
+		case KEY_ESC:
 			return;
 		}
 	}
@@ -794,7 +794,7 @@
 		case 1:
 			show_help(menu);
 			break;
-		case 255:
+		case KEY_ESC:
 			return;
 		}
 	}
@@ -819,7 +819,7 @@
 		case 1:
 			show_helptext(_("Load Alternate Configuration"), load_config_help);
 			break;
-		case 255:
+		case KEY_ESC:
 			return;
 		}
 	}
@@ -843,7 +843,7 @@
 		case 1:
 			show_helptext(_("Save Alternate Configuration"), save_config_help);
 			break;
-		case 255:
+		case KEY_ESC:
 			return;
 		}
 	}
@@ -883,12 +883,15 @@
 	init_wsize();
 	reset_dialog();
 	init_dialog(menu_backtitle);
-	conf(&rootmenu);
-	reset_dialog();
-	res = dialog_yesno(NULL,
-			   _("Do you wish to save your "
-			     "new kernel configuration?"),
-			   5, 60);
+	do {
+		conf(&rootmenu);
+		reset_dialog();
+		res = dialog_yesno(NULL,
+				   _("Do you wish to save your "
+				     "new kernel configuration?\n"
+				     "<ESC><ESC> to continue."),
+				   6, 60);
+	} while (res == KEY_ESC);
 	end_dialog();
 	if (res == 0) {
 		if (conf_write(NULL)) {