summaryrefslogtreecommitdiffstats
path: root/loader2/hdinstall.c
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2008-02-04 11:39:23 -0500
committerChris Lumens <clumens@redhat.com>2008-02-04 16:45:04 -0500
commit7d84cc3e96d50eac2d2bf5581c23fb4430ae9a66 (patch)
treea36d921f23bedb43329c20472dbb48a41bc8ea86 /loader2/hdinstall.c
parent90f1447d542c6575b58edb6d17a3d946dbebace0 (diff)
downloadanaconda-7d84cc3e96d50eac2d2bf5581c23fb4430ae9a66.tar.gz
anaconda-7d84cc3e96d50eac2d2bf5581c23fb4430ae9a66.tar.xz
anaconda-7d84cc3e96d50eac2d2bf5581c23fb4430ae9a66.zip
Don't use quite so many slashes in path names.
Diffstat (limited to 'loader2/hdinstall.c')
-rw-r--r--loader2/hdinstall.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/loader2/hdinstall.c b/loader2/hdinstall.c
index 1c7fe7f31..23f950aae 100644
--- a/loader2/hdinstall.c
+++ b/loader2/hdinstall.c
@@ -82,7 +82,11 @@ static int loadHDImages(char * prefix, char * dir,
target = NULL;
for (; stg2list[idx]; idx++) {
target = stg2list[idx];
- sprintf(path, "%s/%s/images/%s", prefix, dir ? dir : "", target);
+
+ if (!dir || (dir && (!strcmp(dir, "/") || strcmp(dir, ""))))
+ sprintf(path, "%s/images/%s", prefix, target);
+ else
+ sprintf(path, "%s/%s/images/%s", prefix, dir ? dir : "", target);
logMessage(INFO, "Looking for hd stage2 image %s", path);
if (!access(path, F_OK))
@@ -159,7 +163,10 @@ static char * setupIsoImages(char * device, char * dirName, char * location) {
if (!type)
return NULL;
- sprintf(filespec, "/tmp/hdimage/%s", dirName);
+ if (*dirName == '/')
+ sprintf(filespec, "/tmp/hdimage%s", dirName);
+ else
+ sprintf(filespec, "/tmp/hdimage/%s", dirName);
if ((path = validIsoImages(filespec, 0))) {
char updpath[4096];