From a7e7894247de459f0be84c29c45f39c35a595b4d Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Fri, 24 Aug 2001 19:10:30 +0000 Subject: allow unsetting of automatic mode if not enough parameter provided in network steps --- mdk-stage1/network.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'mdk-stage1/network.c') diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c index 6eb28e5e5..ae2c685d2 100644 --- a/mdk-stage1/network.c +++ b/mdk-stage1/network.c @@ -640,8 +640,10 @@ enum return_type nfs_prepare(void) results = ask_from_entries_auto("Please enter the name or IP address of your NFS server, " "and the directory containing the " DISTRIB_NAME " Distribution.", questions, &answers, 40, questions_auto, NULL); - if (results != RETURN_OK) + if (results != RETURN_OK || streq(answers[0], "")) { + unset_param(MODE_AUTOMATIC); /* we are in a fallback mode */ return nfs_prepare(); + } nfsmount_location = malloc(strlen(answers[0]) + strlen(answers[1]) + 2); strcpy(nfsmount_location, answers[0]); @@ -706,8 +708,10 @@ enum return_type ftp_prepare(void) "the directory containing the " DISTRIB_NAME " Distribution, " "and the login/pass if necessary (leave login blank for anonymous).", questions, &answers, 40, questions_auto, NULL); - if (results != RETURN_OK) + if (results != RETURN_OK || streq(answers[0], "")) { + unset_param(MODE_AUTOMATIC); /* we are in a fallback mode */ return ftp_prepare(); + } log_message("FTP: trying to connect to %s", answers[0]); @@ -723,7 +727,6 @@ enum return_type ftp_prepare(void) results = RETURN_BACK; continue; } - strcpy(location_full, answers[1]); strcat(location_full, get_ramdisk_realname()); @@ -790,8 +793,10 @@ enum return_type http_prepare(void) results = ask_from_entries_auto("Please enter the name or IP address of the HTTP server, " "and the directory containing the " DISTRIB_NAME " Distribution.", questions, &answers, 40, questions_auto, NULL); - if (results != RETURN_OK) + if (results != RETURN_OK || streq(answers[0], "")) { + unset_param(MODE_AUTOMATIC); /* we are in a fallback mode */ return http_prepare(); + } strcpy(location_full, answers[1]); strcat(location_full, get_ramdisk_realname()); -- cgit v1.2.1