Subject: Change to libform type_enum behaviour
To: None <current-users@netbsd.org, tech-userlevel@netbsd.org>
From: Brett Lymn <blymn@baesystems.com.au>
List: tech-userlevel
Date: 03/23/2004 11:41:58
Folks,
	A small fix to libform has been committed that fixes a PR
submitted by Peter Postma.  This fix changes the use of the last
argument when calling set_field_type with a type of TYPE_ENUM.

Previously, the last argument determined whether or not blanks at the
end of the enum were significant during a match.  After reviewing the
scant documentation available I now believe this to be incorrect.

I believe the correct behaviour for the final argument is to determine
whether or not the contents of the field are allowed to partially
match an enum.  If this argument is TRUE then the contents of the
field must exactly one of the enum strings (case may or may not be
significant depending on the second to last argument to
set_field_type).  If the final argument to set_field_type is FALSE
then a partial match is allowed, if the contents of the field match
the beginning of an enum string then this is considered a valid match.
For example if the field contents were "foo" then an enum entry of
"foobar " would be considered a match, effectively it allows
"autocompletion" of the enum field on validation of the field.

Note that in all cases leading and trailing spaces are NOT significant
in the matching.

The fix committed implements the behaviour described above..

Since this was an interface change, the major number of libform has
been bumped (actually, this bump was rolled up into a bump required
due to a libcurses change :)

A fix for sushi to use the new libform behaviour has been committed.

Thanks to Peter for reporting this error.

-- 
Brett Lymn