From 98f465c09f6edc56e8332de42fddee9b689b2ed6 Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Sun, 4 Jan 2015 19:42:45 +0000
Subject: 34092: fix miscount of symlink resolution for "..".
This caused problems with expanding a path with ".." in "whence -S".
---
ChangeLog | 3 +++
Src/utils.c | 2 ++
2 files changed, 5 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index ca5d401ab..d1b385f86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2015-01-04 Peter Stephenson
+ * 34092: Src/utils.c: miscount of buffer length in symlink
+ resolution after ".." caused error with whence -S.
+
* 34091: Src/utils.c: typo with "whence -s" expansions.
* users/19682: Doc/Zsh/builtins.yo: document recommended use of
diff --git a/Src/utils.c b/Src/utils.c
index 959df9ab7..390f513ba 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -741,6 +741,8 @@ xsymlinks(char *s, int full)
while (*--p != '/')
xbuflen--;
*p = '\0';
+ /* The \0 isn't included in the length */
+ xbuflen--;
continue;
}
sprintf(xbuf2, "%s/%s", xbuf, *pp);
--
cgit 1.4.1