summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 */