summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/automatic.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1/automatic.c')
-rw-r--r--mdk-stage1/automatic.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/mdk-stage1/automatic.c b/mdk-stage1/automatic.c
index b92cc9e40..57ae1f3a6 100644
--- a/mdk-stage1/automatic.c
+++ b/mdk-stage1/automatic.c
@@ -105,6 +105,28 @@ enum return_type ask_from_list_auto(char *msg, char ** elems, char ** choice, ch
}
}
+enum return_type ask_from_list_comments_auto(char *msg, char ** elems, char ** elems_comments, char ** choice, char * auto_param, char ** elems_auto)
+{
+ if (!IS_AUTOMATIC)
+ return ask_from_list_comments(msg, elems, elems_comments, choice);
+ else {
+ char ** sav_elems = elems;
+ char * tmp = get_auto_value(auto_param);
+ while (elems && *elems) {
+ if (!strcmp(tmp, *elems_auto)) {
+ *choice = *elems;
+ log_message("AUTOMATIC: parameter %s for %s means returning %s", tmp, auto_param, *elems);
+ return RETURN_OK;
+ }
+ elems++;
+ elems_auto++;
+ }
+ unset_param(MODE_AUTOMATIC); /* we are in a fallback mode */
+ return ask_from_list_comments(msg, sav_elems, elems_comments, choice);
+ }
+}
+
+
enum return_type ask_from_entries_auto(char *msg, char ** questions, char *** answers, int entry_size, char ** questions_auto)
{
if (!IS_AUTOMATIC)