summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/file.c b/file.c
index 93ed79b224..079d8cc631 100644
--- a/file.c
+++ b/file.c
@@ -1677,7 +1677,9 @@ file_expand_path(fname, dname, result)
case '\\':
#endif
if (s > b) {
+ long rootdiff = root - buf;
BUFCHECK(p + (s-b+1) >= pend);
+ root = buf + rootdiff;
memcpy(++p, b, s-b);
p += s-b;
*p = '/';