batch of optimisations

This commit is contained in:
tg
2017-04-27 20:22:28 +00:00
parent 1080008a8f
commit d54d4aab50
8 changed files with 50 additions and 67 deletions

13
funcs.c
View File

@@ -38,7 +38,7 @@
#endif
#endif
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.343 2017/04/27 19:33:48 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.344 2017/04/27 20:22:24 tg Exp $");
#if HAVE_KILLPG
/*
@@ -746,10 +746,10 @@ bool
valid_alias_name(const char *cp)
{
while (*cp)
if (!ctype(*cp, C_ALIAS))
return (false);
else
if (ctype(*cp, C_ALIAS))
++cp;
else
return (false);
return (true);
}
@@ -1067,8 +1067,7 @@ c_kill(const char **wp)
int i, n, rv, sig;
/* assume old style options if -digits or -UPPERCASE */
if ((p = wp[1]) && *p == '-' && (ctype(p[1], C_DIGIT) ||
ctype(p[1], C_UPPER))) {
if ((p = wp[1]) && *p == '-' && ctype(p[1], C_DIGIT | C_UPPER)) {
if (!(t = gettrap(p + 1, false, false))) {
bi_errorf(Tbad_sig_s, p + 1);
return (1);
@@ -1419,7 +1418,7 @@ c_umask(const char **wp)
if (ctype(*cp, C_DIGIT)) {
new_umask = 0;
while (asc(*cp) >= asc('0') && asc(*cp) <= asc('7')) {
while (ctype(*cp, C_OCTAL)) {
new_umask = new_umask * 8 + ksh_numdig(*cp);
++cp;
}