=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/less/opttbl.c,v retrieving revision 1.17 retrieving revision 1.18 diff -c -r1.17 -r1.18 *** src/usr.bin/less/opttbl.c 2015/11/12 17:09:57 1.17 --- src/usr.bin/less/opttbl.c 2015/11/12 18:46:50 1.18 *************** *** 466,471 **** --- 466,483 ---- } /* + * + */ + 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. *************** *** 500,509 **** */ for (uppercase = 0; uppercase <= 1; uppercase++) { len = sprefix(optname, oname->oname, uppercase); ! if (len <= 0 || ! isupper((unsigned char)optname[len]) || ! islower((unsigned char)optname[len]) || ! optname[len] == '-') { /* * We didn't use all of the option name. */ --- 512,518 ---- */ for (uppercase = 0; uppercase <= 1; uppercase++) { len = sprefix(optname, oname->oname, uppercase); ! if (len <= 0 || is_optchar(optname[len])) { /* * We didn't use all of the option name. */