On Tue, Mar 17, 2009 at 11:43 PM, erik quanstrom <quans...@quanstro.net> wrote:
> On Tue Mar 17 18:29:14 EDT 2009, urie...@gmail.com wrote:
>> Thanks martin for your analysis, this makes some sense to me, but as I
>> pointed out, even setting ifs to () doesn't solve the issue, so it
>> would be nice to find a solution to this.
>>
>> Right now having the output of `{} corrupted can be quite inconvenient...
>
> it is unreasonable to expect to be able to generate tokens
> that are bigger than 8k.

Well, I would prefer if such limit didn't exist ;) But it doesn't seem
like a totally unreasonable limit either.

>  however, the '8' should not be dropped.

Yes, this is the critical issue, at least if the tokens are just
split, one can join them up by hand if needed, but as things are now
the data gets corrupted in ways that at least at first are mystifying,
and which are hard to work around.

> i would think this small change would be worth
> consideration.

I will give it a try when I get a chance, but if it fixes the lost
chars, I'll be happy.

Thanks!

uriel

> ; diffy -c havefork.c
> /n/dump/2009/0317/sys/src/cmd/rc/havefork.c:74,80 - havefork.c:74,80
>  Xbackq(void)
>  {
>        char wd[8193];
> -       int c;
> +       int c, trunc;
>        char *s, *ewd=&wd[8192], *stop;
>        struct io *f;
>        var *ifs = vlook("ifs");
> /n/dump/2009/0317/sys/src/cmd/rc/havefork.c:105,113 - havefork.c:105,116
>                while((c = rchr(f))!=EOF){
>                        if(strchr(stop, c) || s==ewd){
>                                if(s!=wd){
> +                                       trunc = s == ewd;
>                                        *s='\0';
>                                        v = newword(wd, v);
>                                        s = wd;
> +                                       if(trunc)
> +                                               *s++ = c;
>                                }
>                        }
>                        else *s++=c;
>
> - erik
>
>

Reply via email to