about summary refs log tree commit diff
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
parent176ba3153192ce118548c1b1f6f1fae1dfda15ee (diff)
downloadzsh-8d956e9bcb8fe5aa3ca92e3c856b26800af11ff5.tar.gz
zsh-8d956e9bcb8fe5aa3ca92e3c856b26800af11ff5.tar.xz
zsh-8d956e9bcb8fe5aa3ca92e3c856b26800af11ff5.zip
24048: fix home directory expansion with NIS on Solaris
-rw-r--r--ChangeLog3
-rw-r--r--Src/hashtable.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 87781da59..5334df940 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-11-01  Oliver Kiddle  <opk@zsh.org>
 
+	* 24048: Src/hashtable.c: fix home directory expansion with
+	NIS on Solaris
+
 	* Frank Benkstein: 24047: Completion/compinit: fix compdef
 	with more than three commands using the same service
 
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])