Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: shorthand for splitting on null bytes.
- X-seq: zsh-workers 22375
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: PATCH: shorthand for splitting on null bytes.
- Date: Wed, 22 Mar 2006 12:06:54 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
I've been missing this. Any comments? Is a shorthand for joining
things together with nulls useful?
Index: Doc/Zsh/expn.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/expn.yo,v
retrieving revision 1.63
diff -u -r1.63 expn.yo
--- Doc/Zsh/expn.yo 20 Mar 2006 11:06:25 -0000 1.63
+++ Doc/Zsh/expn.yo 22 Mar 2006 12:01:17 -0000
@@ -826,6 +826,10 @@
in `tt(${${(z)foo}[2]})'. Likewise, to remove the quotes in the
resulting words one would do: `tt(${(Q)${(z)foo}})'.
)
+item(tt(0))(
+Split the result of the expansion on null bytes. This is a shorthand
+for `tt(ps:\0:)'.
+)
enditem()
The following flags (except tt(p)) are followed by one or more arguments
Index: Src/subst.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/subst.c,v
retrieving revision 1.49
diff -u -r1.49 subst.c
--- Src/subst.c 7 Mar 2006 22:05:51 -0000 1.49
+++ Src/subst.c 22 Mar 2006 12:01:18 -0000
@@ -1274,6 +1274,13 @@
sep = "\n";
break;
+ case '0':
+ spsep = zhalloc(3);
+ spsep[0] = Meta;
+ spsep[1] = ' ';
+ spsep[2] = '\0';
+ break;
+
case 's':
tt = 1;
/* fall through */
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
Messages sorted by:
Reverse Date,
Date,
Thread,
Author