about summary refs log tree commit diff
path: root/Src
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 /Src
parent59d84accb399aaaf273f38a82f0bf257d4c36420 (diff)
downloadzsh-9e1a3e6d062522c77f17d8be947850ee824cee8e.tar.gz
zsh-9e1a3e6d062522c77f17d8be947850ee824cee8e.tar.xz
zsh-9e1a3e6d062522c77f17d8be947850ee824cee8e.zip
26752: fix ../ removal and metafication in :a and :A modifers
Diffstat (limited to 'Src')
-rw-r--r--Src/hist.c10
1 files changed, 7 insertions, 3 deletions
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;
 }