Subject: lib/9704: libedit history storage is 1 off.
To: None <gnats-bugs@gnats.netbsd.org>
From: Phil Nelson <phil@ldc.cs.wwu.edu>
List: netbsd-bugs
Date: 03/29/2000 17:05:47
>Number:         9704
>Category:       lib
>Synopsis:       libedit history storage is 1 off.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 29 17:06:00 2000
>Last-Modified:
>Originator:     Phil Nelson
>Organization:
	Western Washington University
>Release:        NetBSD-1.4.1 and up to NetBSD-current/March 22, 2000.
>Environment:
System: NetBSD nooksack 1.4.1 NetBSD 1.4.1 (NOOKSACK) #0: Thu Aug 26 11:00:53 PDT 1999 phil@middlefork:/puffin/NetBSD-1.4.1/usr/src/sys/arch/i386/compile/NOOKSACK i386


>Description:
	libedit history mechanism keeps a history of input lines.
	The number of lines in the history is set by a call to
		history (hist, H_SETSIZE, size)
	And when this is set, libedit keeps one extra line than
	was requested.

>How-To-Repeat:
	sh -E
	$ HISTSIZE=5
	$ 1
	$ 2
	$ 3
	$ 4
	$ 5
	$ 6
	$ 7
	$  (Now ^P back and see you still see 2, but not the 1, which
 	    is 6 elements of history, not 5.)
	$ HISTSIZE=0
	$ 1
	$ 2
	$  (Now ^P back and you see 2, but not 1, which is 1 element,
	    not 1!)

>Fix:

	I couldn't find it in my quick look.
>Audit-Trail:
>Unformatted: