OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
CVS: cvs.openbsd.org: src

From: Ray Lai (raycvs.openbsd.org)
Date: Sat Mar 11 2006 - 01:04:53 CST


CVSROOT: /cvs
Module name: src
Changes by: raycvs.openbsd.org 2006/03/11 00:04:53

Modified files:
        usr.bin/vi/common: options.c

Log message:
Fixes the `optindx' might be used uninitialized in this function
warning, fixes a spacing nit in a macro, and cleans up a very bad
preprocessor abuse (``if LF_ISSET(OS_DEF)''!)

optindx turns out to be the index number of the gigantic option
list at the beginning of the file. All we need to do is set it
before every ``goto err''.

The first four are global options, which you can just set optindx
to the second argument of o_set().

The last one is in a loop that uses cnt as the index. Since that
is cnt's only use, I just removed cnt and used optindx instead.
optindx is always updated and we use one less variable.

ok miod, otto