summaryrefslogtreecommitdiffstats
path: root/loader2
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2006-10-31 15:10:14 +0000
committerChris Lumens <clumens@redhat.com>2006-10-31 15:10:14 +0000
commitfe6b9c7a146fa745fce07d015703c6c56e17b9e1 (patch)
tree6f501883587d1c492668bb68b3f76bff4464a799 /loader2
parent73da8b61eaec10a07086020eb138d4bd225bfbe4 (diff)
downloadanaconda-fe6b9c7a146fa745fce07d015703c6c56e17b9e1.tar.gz
anaconda-fe6b9c7a146fa745fce07d015703c6c56e17b9e1.tar.xz
anaconda-fe6b9c7a146fa745fce07d015703c6c56e17b9e1.zip
Fix up how we assemble URLs a little bit.
Diffstat (limited to 'loader2')
-rw-r--r--loader2/kickstart.c16
-rw-r--r--loader2/urlinstall.c4
2 files changed, 11 insertions, 9 deletions
diff --git a/loader2/kickstart.c b/loader2/kickstart.c
index 3d53cd462..a32ded31b 100644
--- a/loader2/kickstart.c
+++ b/loader2/kickstart.c
@@ -294,19 +294,21 @@ int getKickstartFromBlockDevice(char *device, char *path) {
}
void getHostandPath(char * ksSource, char **host, char ** file, char * ip) {
- *host = malloc(strlen(ksSource) + 1);
- strcpy(*host, ksSource);
+ char *tmp;
- *file = strchr(*host, '/');
+ *host = strdup(ksSource);
+ tmp = strchr(*host, '/');
- if (*file) {
- **file = '\0';
- *file = *file + 1;
- } else {
+ if (tmp) {
+ *file = strdup(tmp);
+ *tmp = '\0';
+ }
+ else {
*file = malloc(sizeof(char *));
**file = '\0';
}
+ logMessage(DEBUGLVL, "getHostandPath host: |%s|", *host);
logMessage(DEBUGLVL, "getHostandPath file(1): |%s|", *file);
/* if the filename ends with / or is null, use default kickstart
diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c
index 13c5c634e..e432515fb 100644
--- a/loader2/urlinstall.c
+++ b/loader2/urlinstall.c
@@ -359,7 +359,7 @@ int getFileFromUrl(char * url, char * dest,
getHostandPath((proto == URL_METHOD_FTP ? url + 6 : url + 7),
&host, &file, ret);
- logMessage(INFO, "file location: %s://%s/%s",
+ logMessage(INFO, "file location: %s://%s%s",
(proto == URL_METHOD_FTP ? "ftp" : "http"), host, file);
chptr = strchr(host, '/');
@@ -413,7 +413,7 @@ int getFileFromUrl(char * url, char * dest,
fd = urlinstStartTransfer(&ui, file, ehdrs);
if (fd < 0) {
- logMessage(ERROR, "failed to retrieve http://%s/%s/%s", ui.address, ui.prefix, file);
+ logMessage(ERROR, "failed to retrieve http://%s/%s%s", ui.address, ui.prefix, file);
if (ehdrs) free(ehdrs);
return 1;
}