summaryrefslogtreecommitdiffstats
path: root/loader/urls.c
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2001-07-02 20:28:05 +0000
committerMatt Wilson <msw@redhat.com>2001-07-02 20:28:05 +0000
commitc45f97a7007c92ca98889e380b98c8cbd4d3fd7e (patch)
tree09b51b80cad373ea8d74fab0dfb15a4bcbf84c5a /loader/urls.c
parent3fd75c3831c228d78c55be355a203c9779b78429 (diff)
downloadanaconda-c45f97a7007c92ca98889e380b98c8cbd4d3fd7e.tar.gz
anaconda-c45f97a7007c92ca98889e380b98c8cbd4d3fd7e.tar.xz
anaconda-c45f97a7007c92ca98889e380b98c8cbd4d3fd7e.zip
add / in the front of the dir if it is missing (#47039)
Diffstat (limited to 'loader/urls.c')
-rw-r--r--loader/urls.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/loader/urls.c b/loader/urls.c
index d3a92f804..c59a2b918 100644
--- a/loader/urls.c
+++ b/loader/urls.c
@@ -264,6 +264,15 @@ int urlMainSetupPanel(struct iurlinfo * ui, urlprotocol protocol,
ui->address = strdup(site);
if (ui->prefix) free(ui->prefix);
+
+ /* add a slash at the start of the dir if it is missing */
+ if (*dir != '/') {
+ char *buf = malloc(strlen(dir) + 2);
+ buf[0] = '/';
+ buf[1] = '\0';
+ strcat (buf, dir);
+ }
+
ui->prefix = strdup(dir);
/* Get rid of trailing /'s */