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

Re: Chatty little precompiler for _arguments



Tanaka Akira wrote:

> In article <199909230913.LAA23608@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
>   Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> writes:
> 
> > The longest string a character can be quoted to is three characters...
> 
> It's not longest, in current implementation at least.
> 
> Z:akr@is27e1u11% Src/zsh -f
> is27e1u11% a="'''''''''''"
> is27e1u11% print -lr - ${(qq)a}
> zsh: segmentation fault (core dumped)  Src/zsh -f
> Z:akr@is27e1u11% 

Ouch.

Bye
 Sven

--- os/utils.c	Thu Sep 23 12:30:20 1999
+++ Src/utils.c	Thu Sep 23 16:05:22 1999
@@ -2976,7 +2976,7 @@
 {
     const char *u, *tt;
     char *v;
-    char *buf = ncalloc(3 * strlen(s) + 1);
+    char *buf = ncalloc(4 * strlen(s) + 1);
     int sf = 0;
 
     tt = v = buf;

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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