9fans archive / 1999 / 06 / 26 /    prev next

From: Tom Duff td@pix...
Subject: [9fans] minor glitch with free carets
Date: Thu, 10 Jun 1999 09:01:25 -0700

On Jun 10, 10:04am, Elliott Hughes wrote:
> Subject: Re:  [9fans] minor glitch with free carets
> with Byron's rc:
>
> % echo while'b'
> whileb

I spoke to Rob Pike yesterday and mentioned that I thought
that free carets were the single stupidest thing in rc.
Don't use them.  Take them out of the code.  (Apparently
I always knew this.  There's a comment in the code where
this is implemented that uses the word `embarassing.')

BTW, the bug is on line 318 of /sys/src/cmd/rc/lex.c:

	if(t->type!=WORD) lastword=0;

I think that changing this to

	lastword=0;

fixes it (I don't have a plan 9 machine, so I can't test it.)
d


-- 
Tom Duff.  If UNIX is the great novel, Perl is the Cliff's Notes.