9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Strange rc bug for the 9fans bug-squashing squad
@ 2009-03-17  0:40 geoff
  2009-03-17 22:16 ` Uriel
  0 siblings, 1 reply; 23+ messages in thread
From: geoff @ 2009-03-17  0:40 UTC (permalink / raw)
  To: 9fans

Setting ifs='' defeats rc's tokenisation, so the result
of `{} will be a series of rc `words', each limited to
Wordmax (8192) bytes and with the next byte of the input
stream after each word set to NUL.

Did you perhaps intend to write ifs=(), which has different
meaning?



^ permalink raw reply	[flat|nested] 23+ messages in thread
* [9fans] Strange rc bug for the 9fans bug-squashing squad
@ 2009-03-16 23:26 Uriel
  2009-03-17  1:31 ` Martin Neubauer
  0 siblings, 1 reply; 23+ messages in thread
From: Uriel @ 2009-03-16 23:26 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

At first I thought very big rc variables seem to become strangely corrupted.

% for(i in `{seq 1000}) { echo 0123456789 >> f }
% ifs='' {x=`{cat f}}
% echo -n $x > f2
% diff f f2
745c745
< 0123456789
---
> 01234567 9

But the bug seems to be in `{ } because replacing the use of the x var
with simply:

% ifs='' { echo -n `{cat f} > f2}

Produces the same results.

Longer strings get more random(?) characters 'blanked'.

The results are identical in p9p and native plan9.

I looked a bit around the rc source that seemed relevant, but didn't
see any obvious errors, but I don't fully understand the code.

Peace

uriel



^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2009-03-18 15:27 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-17  0:40 [9fans] Strange rc bug for the 9fans bug-squashing squad geoff
2009-03-17 22:16 ` Uriel
2009-03-17 22:24   ` erik quanstrom
2009-03-17 23:14     ` Uriel
  -- strict thread matches above, loose matches on Subject: below --
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
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

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).