summaryrefslogtreecommitdiffstats
path: root/loader/urls.c
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>1999-11-23 21:08:56 +0000
committerMatt Wilson <msw@redhat.com>1999-11-23 21:08:56 +0000
commitc3d5a7b0d5d8aafbd13ef57147e0920c8410d1ef (patch)
tree1065f8143691c136cfc1d01b70e7bab93ac5aa43 /loader/urls.c
parentc6949a368ffe68f43f1eddb6973e5eabeb140833 (diff)
downloadanaconda-c3d5a7b0d5d8aafbd13ef57147e0920c8410d1ef.tar.gz
anaconda-c3d5a7b0d5d8aafbd13ef57147e0920c8410d1ef.tar.xz
anaconda-c3d5a7b0d5d8aafbd13ef57147e0920c8410d1ef.zip
merge with anaconda-6-1-1-merge-2
Diffstat (limited to 'loader/urls.c')
-rw-r--r--loader/urls.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/loader/urls.c b/loader/urls.c
index ff5f65eb5..5c991bc6c 100644
--- a/loader/urls.c
+++ b/loader/urls.c
@@ -107,6 +107,7 @@ int urlMainSetupPanel(struct iurlinfo * ui, urlprotocol protocol,
char * reflowedText = NULL;
int width, height, len;
newtGrid entryGrid, buttons, grid;
+ char * chptr;
if (ui->address) {
site = ui->address;
@@ -207,7 +208,14 @@ int urlMainSetupPanel(struct iurlinfo * ui, urlprotocol protocol,
_("You must enter a directory."));
continue;
}
+
+ if (!addrToIp(site)) {
+ newtWinMessage(_("Unknown Host"), _("Ok"),
+ _("%s is not a valid hostname."), site);
+ continue;
+ }
}
+
break;
} while (1);
@@ -224,6 +232,12 @@ int urlMainSetupPanel(struct iurlinfo * ui, urlprotocol protocol,
if (ui->prefix) free(ui->prefix);
ui->prefix = strdup(dir);
+ /* Get rid of trailing /'s */
+ chptr = ui->prefix + strlen(ui->prefix) - 1;
+ while (chptr > ui->prefix && *chptr == '/') chptr--;
+ chptr++;
+ *chptr = '\0';
+
if (ui->urlprefix) free(ui->urlprefix);
len = strlen(ui->address);
if (len < 15) len = 15;