That helper function I just tweaked has a total of one usage. Maybe just
inline it?
Index: opttbl.c
===================================================================
RCS file: /cvs/src/usr.bin/less/opttbl.c,v
retrieving revision 1.16
diff -u -p -r1.16 opttbl.c
--- opttbl.c 12 Nov 2015 03:13:37 -0000 1.16
+++ opttbl.c 12 Nov 2015 04:43:11 -0000
@@ -466,18 +466,6 @@ findopt(int c)
}
/*
- *
- */
-static int
-is_optchar(unsigned char c)
-{
- if (isupper(c) || islower(c) || c == '-')
- return (1);
- else
- return (0);
-}
-
-/*
* Find an option in the option table, given its option name.
* p_optname is the (possibly partial) name to look for, and
* is updated to point after the matched name.
@@ -512,7 +500,10 @@ findopt_name(char **p_optname, char **p_
*/
for (uppercase = 0; uppercase <= 1; uppercase++) {
len = sprefix(optname, oname->oname, uppercase);
- if (len <= 0 || is_optchar(optname[len])) {
+ if (len <= 0 ||
+ isupper((unsigned char)optname[len]) ||
+ islower((unsigned char)optname[len]) ||
+ optname[len] == '-') {
/*
* We didn't use all of the option name.
*/