9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Uriel <uriel99@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Strange rc bug for the 9fans bug-squashing squad
Date: Wed, 18 Mar 2009 00:23:15 +0100	[thread overview]
Message-ID: <5d375e920903171623o342cd0e9t71c99f1610336273@mail.gmail.com> (raw)
In-Reply-To: <d24a583732d5d79d08fab85a850bdfd8@quanstro.net>

On Tue, Mar 17, 2009 at 11:43 PM, erik quanstrom <quanstro@quanstro.net> wrote:
> On Tue Mar 17 18:29:14 EDT 2009, uriel99@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	other threads:[~2009-03-17 23:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-16 23:26 Uriel
2009-03-17  1:31 ` Martin Neubauer
2009-03-17  2:01   ` Martin Neubauer
2009-03-17 22:27     ` Uriel
2009-03-17 22:43       ` erik quanstrom
2009-03-17 23:23         ` Uriel [this message]
2009-03-17 23:26           ` erik quanstrom
2009-03-18  0:26             ` Uriel
2009-03-18  1:23               ` Russ Cox
2009-03-18  7:31                 ` Gabriel Díaz López de la Llave
2009-03-18 10:31                 ` maht
2009-03-18 15:27                   ` erik quanstrom
2009-03-18  1:25               ` erik quanstrom
2009-03-18 11:30                 ` Uriel
2009-03-18 10:53         ` roger peppe
2009-03-18 13:18           ` erik quanstrom
2009-03-18 13:52             ` roger peppe
2009-03-18 14:16               ` erik quanstrom
2009-03-18 14:36                 ` roger peppe
2009-03-17  0:40 geoff
2009-03-17 22:16 ` Uriel
2009-03-17 22:24   ` erik quanstrom
2009-03-17 23:14     ` Uriel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d375e920903171623o342cd0e9t71c99f1610336273@mail.gmail.com \
    --to=uriel99@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).