diff options
| author | Paul Saab <ps@FreeBSD.org> | 2000-07-14 09:51:40 +0000 |
|---|---|---|
| committer | Paul Saab <ps@FreeBSD.org> | 2000-07-14 09:51:40 +0000 |
| commit | 8ed69c6ff9a57551420d2cb6f67c989b37477cb5 (patch) | |
| tree | f3a476e74c05bfed5be5c76fca73660c52bd2cc5 /contrib/less/decode.c | |
| parent | a5f0fb151d90effe79714de0fa059954725fe57f (diff) | |
Notes
Diffstat (limited to 'contrib/less/decode.c')
| -rw-r--r-- | contrib/less/decode.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/less/decode.c b/contrib/less/decode.c index 7fb03dfeb7d7..46ac21bcd5f8 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); } |
