diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/src/parse.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/src/parse.c b/src/src/parse.c index fcea2ea26..e30b80527 100644 --- a/src/src/parse.c +++ b/src/src/parse.c @@ -1422,8 +1422,10 @@ for (;;) if (directory) { int len = Ustrlen(directory); - uschar * p = filename + len; + uschar * p; + while (len > 0 && directory[len-1] == '/') len--; /* ignore trailing '/' */ + p = filename + len; if (Ustrncmp(filename, directory, len) != 0 || *p != '/') { *error = string_sprintf("included file %s is not in directory %s", @@ -1448,9 +1450,10 @@ for (;;) { uschar temp; int fd2; - uschar * q = p; + uschar * q = p + 1; /* skip dividing '/' */ - while (*++p && *p != '/') ; + while (*q == '/') q++; /* skip extra '/' */ + while (*++p && *p != '/') ; /* end of component */ temp = *p; *p = '\0'; |