summaryrefslogtreecommitdiffstats
path: root/contrib/less/decode.c
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2000-07-14 09:51:40 +0000
committerps <ps@FreeBSD.org>2000-07-14 09:51:40 +0000
commit5d465776b9e058088e1f29636cf7cdcb0c13eb0d (patch)
treef3a476e74c05bfed5be5c76fca73660c52bd2cc5 /contrib/less/decode.c
parent1b28029810e9c377087ea5a45acc8767cf0196b3 (diff)
downloadFreeBSD-src-5d465776b9e058088e1f29636cf7cdcb0c13eb0d.zip
FreeBSD-src-5d465776b9e058088e1f29636cf7cdcb0c13eb0d.tar.gz
Import less v358.
Diffstat (limited to 'contrib/less/decode.c')
-rw-r--r--contrib/less/decode.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/less/decode.c b/contrib/less/decode.c
index 7fb03df..46ac21b 100644
--- a/contrib/less/decode.c
+++ b/contrib/less/decode.c
@@ -373,7 +373,7 @@ add_var_table(tlist, buf, len)
/*
* Search a single command table for the command string in cmd.
*/
- public int
+ static int
cmd_search(cmd, table, endtable, sp)
char *cmd;
char *table;
@@ -384,6 +384,7 @@ cmd_search(cmd, table, endtable, sp)
register char *q;
register int a;
+ *sp = NULL;
for (p = table, q = cmd; p < endtable; p++, q++)
{
if (*p == *q)
@@ -417,8 +418,7 @@ cmd_search(cmd, table, endtable, sp)
{
*sp = ++p;
a &= ~A_EXTRA;
- } else
- *sp = NULL;
+ }
return (a);
}
} else if (*q == '\0')
@@ -484,6 +484,8 @@ cmd_decode(tlist, cmd, sp)
if (action != A_INVALID)
break;
}
+ if (action == A_UINVALID)
+ action = A_INVALID;
return (action);
}
OpenPOWER on IntegriCloud