From c95606f05036a0e17828f3d512eab3f43505719b Mon Sep 17 00:00:00 2001 From: mmcc Date: Thu, 12 Nov 2015 17:09:58 +0000 Subject: Inline is_optchar(), a helper function with only one usage. ok nicm@, stsp@ --- usr.bin/less/opttbl.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'usr.bin/less') diff --git a/usr.bin/less/opttbl.c b/usr.bin/less/opttbl.c index 144c1e7af4b..1e9ac28ebc4 100644 --- a/usr.bin/less/opttbl.c +++ b/usr.bin/less/opttbl.c @@ -465,18 +465,6 @@ findopt(int c) return (NULL); } -/* - * - */ -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 @@ -512,7 +500,10 @@ findopt_name(char **p_optname, char **p_oname, int *p_err) */ 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. */ -- cgit v1.2.3