Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] hist: untokenise input to :A and :P



  % echo ${${:-/a-b=c}:P}
  /a?b?c

is it as simple as this? i'm still not really clear on when things get
(un)tokenised or (un)metafied, why doing this won't (?) break in some
other case where these bytes are part of a utf-8 character, etc

dana


diff --git a/Src/hist.c b/Src/hist.c
index 00bdbb2b8..5d47fc1a5 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -1994,6 +1994,7 @@ chrealpath(char **junkptr, char mode, int use_heap)
     if (**junkptr != '/')
 	return 0;
 
+    untokenize(*junkptr);
     unmetafy(*junkptr, NULL);
 
     lastpos = strend(*junkptr);
diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst
index 4d88e5c27..72018a94b 100644
--- a/Test/D02glob.ztst
+++ b/Test/D02glob.ztst
@@ -694,6 +694,10 @@
 0:modifier ':P' with path too long
 >16001
 
+ print -r ${${:-/a-b=c}:P}
+0:modifier ':P' with tokenised input
+>/a-b=c
+
  foo=a
  value="ac"
  print ${value//[${foo}b-z]/x}




Messages sorted by: Reverse Date, Date, Thread, Author