summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/network.c
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-07-01 07:24:19 +0000
committerOlivier Blin <oblin@mandriva.org>2004-07-01 07:24:19 +0000
commit34eed59c1db310839da45fed0f9dcbe182267e8c (patch)
tree17078b6862a8967c6210ac2e2d39641ba74173c4 /mdk-stage1/network.c
parent79d9d54b2599348cf27db2e1900119a74a08347e (diff)
downloaddrakx-34eed59c1db310839da45fed0f9dcbe182267e8c.tar
drakx-34eed59c1db310839da45fed0f9dcbe182267e8c.tar.gz
drakx-34eed59c1db310839da45fed0f9dcbe182267e8c.tar.bz2
drakx-34eed59c1db310839da45fed0f9dcbe182267e8c.tar.xz
drakx-34eed59c1db310839da45fed0f9dcbe182267e8c.zip
add a slash at beginning of the given directory if not already present (ftp and http install)
Diffstat (limited to 'mdk-stage1/network.c')
-rw-r--r--mdk-stage1/network.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c
index 4986fdc00..d307e414b 100644
--- a/mdk-stage1/network.c
+++ b/mdk-stage1/network.c
@@ -924,6 +924,13 @@ enum return_type ftp_prepare(void)
use_http_proxy = !streq(http_proxy_host, "") && !streq(http_proxy_port, "");
+ if (answers[1][0] == '/') {
+ strcpy(location_full, answers[1]);
+ } else {
+ strcpy(location_full, "/");
+ strcat(location_full, answers[1]);
+ }
+
if (use_http_proxy) {
log_message("FTP: don't connect to %s directly, will use proxy", answers[0]);
} else {
@@ -941,7 +948,7 @@ enum return_type ftp_prepare(void)
continue;
}
- strcpy(modules_cz, answers[1]);
+ strcpy(modules_cz, location_full);
strcat(modules_cz, LIVE_LOCATION "lib/modules.cz-");
strcat(modules_cz, kernel_uname.release);
@@ -953,7 +960,6 @@ enum return_type ftp_prepare(void)
}
}
- strcpy(location_full, answers[1]);
strcat(location_full, get_ramdisk_realname());
log_message("FTP: trying to retrieve %s", location_full);
@@ -1055,7 +1061,12 @@ enum return_type http_prepare(void)
return http_prepare();
}
- strcpy(location_full, answers[1]);
+ if (answers[1][0] == '/') {
+ strcpy(location_full, answers[1]);
+ } else {
+ strcpy(location_full, "/");
+ strcat(location_full, answers[1]);
+ }
strcat(location_full, get_ramdisk_realname());
log_message("HTTP: trying to retrieve %s from %s", location_full, answers[0]);