o Add __BEGIN_DECLS/__END_DECLS to include files
o Safe macros
o Remove useless variable assignment in the End function of *hl.c
o Some minor KNF, needs more
From Dan Weeks
sparc64. Change cast back to unsigned char but do a bitwise AND
with 0xff to avoid any sign extension weirdness and to make it
impossible for us to overflow _C_ctype_. The bitwise AND is probably
not needed and may be removed later if this does not trigger compiler bugs.
code that assign a u_int value to x_handy. However, this means
that we need to be careful checking for overflow as we can no longer
subtract a value and check the result for < 0. We reorder the
expression instead to avoid this problem (basic algebra).
deraadt@ OK
it is not the fist character of optstring (since that would conflict
with GNU semantics).
Update the bit on "W;" within optstring when called as getopt (not
getopt_long) to current reality.
o Check for long options even when not at the beginning of an option.
For instance, if -a is a short option w/o an arg and -static is a
boolean long option then -astatic is valid for getopt_long_only().
o If a potential long argument does not match longopts and the first
character is not a short option, print a warning and skip the rest
of the argument.
Also clean up some trailing whitespace and change return value of
parse_long_options() from -2 to -1 when unmatched and in long_only mode.
With these fixes the binutils ld seems happy with our getopt_long_only()
In order for getopt_only_only() to work we need to check for long
options before short ones. I have merged getopt_internal and
getopt_long_internal into a single function with the actual long
args parsing broken out into a separate function.
This also simplifies the flow of control.
getopt_long_only(). At some point this should replace the BSD
getopt(3) but we are not there yet.
While I am here add protection from the multiple getopt() definitions
due to conflicting standards.