csh history bug

Roland McGrath rk9005 at cca.ucsf.edu
Sat Apr 23 11:27:28 AEST 1988


Index: 4.3 BSD and Sun 3.2 (and greater, probably), csh
     I have repeated this on 4.3 BSD Vaxen and Sun Unix 3.2 Sun 3/50s.

Repeat-by:
	$ csh -f
	% set history=5000
	% echo foo
	foo
	% ^foo^bar
	echo bar
	bar
	% history
	     1  set history=5000
	     2  echo foo
	 -1000  echo bar     3  echo bar
	     4  history
	%

    Any large value for `history' will do it.  I have been unable to find
the exact threshold, but anything larger than 2000 will always work, I think.
I guess most people don't set history to a big number, so they haven't
noticed it.  This will also happen using `!!:s/foo/bar' or '!2:s/foo/bar',
as well as with the trailing ^ or / appended.


Aside: Can anyone with source access tell me what type is used for the
value of `history', so I can make it 32767 or (2^31) - 1, or whatever?



More information about the Comp.bugs.4bsd.ucb-fixes mailing list