about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-03-18 19:38:38 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-03-18 19:38:38 +0000
commit9e1a3e6d062522c77f17d8be947850ee824cee8e (patch)
treef141acca8757c3f52792ea4db0744e533cff798a
parent59d84accb399aaaf273f38a82f0bf257d4c36420 (diff)
downloadzsh-9e1a3e6d062522c77f17d8be947850ee824cee8e.tar.gz
zsh-9e1a3e6d062522c77f17d8be947850ee824cee8e.tar.xz
zsh-9e1a3e6d062522c77f17d8be947850ee824cee8e.zip
26752: fix ../ removal and metafication in :a and :A modifers
-rw-r--r--ChangeLog7
-rw-r--r--Src/hist.c10
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index ad588693a..41fddecc1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-18  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 26752: Src/hist.c: fix ../ removal in :a and metafication
+	in :a and :A modifiers.
+
 2009-03-18  Peter Stephenson  <pws@csr.com>
 
 	* Frank Terbeck: 26751: Functions/VCS_Info/vcs_info_setsys:
@@ -11438,5 +11443,5 @@
 
 *****************************************************
 * This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.4623 $
+* $Revision: 1.4624 $
 *****************************************************
diff --git a/Src/hist.c b/Src/hist.c
index c8625c7af..4a2c12530 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -1507,7 +1507,7 @@ chabspath(char **junkptr)
 	return 1;
 
     if (**junkptr != '/') {
-	*junkptr = zhtricat(zgetcwd(), "/", *junkptr);
+	*junkptr = zhtricat(metafy(zgetcwd(), -1, META_HEAPDUP), "/", *junkptr);
     }
 
     current = *junkptr;
@@ -1556,6 +1556,8 @@ chabspath(char **junkptr)
 		    if (dest[-1] != '/')
 			dest--;
 		    current += 2;
+		    if (*current == '/')
+			current++;
 		} else if (dest == *junkptr + 1) {
 		    /* This might break with Cygwin's leading double slashes? */
 		    current += 2;
@@ -1567,7 +1569,7 @@ chabspath(char **junkptr)
 	} else {
 	    while (*current != '/' && *current != '\0')
 		if ((*dest++ = *current++) == Meta)
-		    dest[-1] = *current++ ^ 32;
+		    *dest++ = *current++;
 	}
     }
     return 1;
@@ -1593,6 +1595,8 @@ chrealpath(char **junkptr)
     if (**junkptr != '/')
 	return 0;
 
+    unmetafy(*junkptr, NULL);
+
     lastpos = strend(*junkptr);
     nonreal = lastpos + 1;
 
@@ -1618,7 +1622,7 @@ chrealpath(char **junkptr)
 	str++;
     }
 
-    *junkptr = bicat(real, nonreal);
+    *junkptr = metafy(bicat(real, nonreal), -1, META_HEAPDUP);
 
     return 1;
 }