about summary refs log tree commit diff
path: root/Src/hashtable.c
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2007-11-01 10:59:40 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2007-11-01 10:59:40 +0000
commit8d956e9bcb8fe5aa3ca92e3c856b26800af11ff5 (patch)
tree4c7317bc68691dfce61c432417f3f9b0dd150f41 /Src/hashtable.c
parent176ba3153192ce118548c1b1f6f1fae1dfda15ee (diff)
downloadzsh-8d956e9bcb8fe5aa3ca92e3c856b26800af11ff5.tar.gz
zsh-8d956e9bcb8fe5aa3ca92e3c856b26800af11ff5.tar.xz
zsh-8d956e9bcb8fe5aa3ca92e3c856b26800af11ff5.zip
24048: fix home directory expansion with NIS on Solaris
Diffstat (limited to 'Src/hashtable.c')
-rw-r--r--Src/hashtable.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/hashtable.c b/Src/hashtable.c
index d820c4fd4..160cda506 100644
--- a/Src/hashtable.c
+++ b/Src/hashtable.c
@@ -1258,7 +1258,8 @@ add_userdir(int status, char *key, int keylen, char *val, int vallen, char *dumm
 
     if (vallen > keylen && *(p = val + keylen) == ':') {
 	*p++ = '\0';
-	if ((de = strrchr(p, ':'))) {
+	for (de = val + vallen - 1; *de != ':' && de > val; de--);
+	if (de > val) {
 	    *de = '\0';
 	    if ((d = strrchr(p, ':'))) {
 		if (*++d && val[0])