summaryrefslogtreecommitdiff
path: root/lesskey.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2017-04-29 06:30:21 +0000
committerXin LI <delphij@FreeBSD.org>2017-04-29 06:30:21 +0000
commit6f90225e8378d85045013553763bd7483670441c (patch)
tree185b77b1a31a3ec3a39749f691ca4a8c273e9e1c /lesskey.c
parent9c83c2751d26fe2e059d6956f0398b56ed919a6a (diff)
Notes
Diffstat (limited to 'lesskey.c')
-rw-r--r--lesskey.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/lesskey.c b/lesskey.c
index f565ec62f764..686f6e4ffdad 100644
--- a/lesskey.c
+++ b/lesskey.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 1984-2016 Mark Nudelman
+ * Copyright (C) 1984-2017 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
@@ -361,9 +361,9 @@ tstr(pp, xlate)
char **pp;
int xlate;
{
- register char *p;
- register char ch;
- register int i;
+ char *p;
+ char ch;
+ int i;
static char buf[10];
static char tstr_control_k[] =
{ SK_SPECIAL_KEY, SK_CONTROL_K, 6, 1, 1, 1, '\0' };
@@ -423,7 +423,7 @@ tstr(pp, xlate)
case 'e': ch = SK_END; break;
case 'x': ch = SK_DELETE; break;
default:
- error("illegal char after \\k");
+ error("illegal char after \\k", NULL_PARG);
*pp = p+1;
return ("");
}
@@ -474,7 +474,7 @@ tstr(pp, xlate)
*/
public char *
skipsp(s)
- register char *s;
+ char *s;
{
while (*s == ' ' || *s == '\t')
s++;
@@ -486,7 +486,7 @@ skipsp(s)
*/
public char *
skipnsp(s)
- register char *s;
+ char *s;
{
while (*s != '\0' && *s != ' ' && *s != '\t')
s++;
@@ -501,7 +501,7 @@ skipnsp(s)
clean_line(s)
char *s;
{
- register int i;
+ int i;
s = skipsp(s);
for (i = 0; s[i] != '\n' && s[i] != '\r' && s[i] != '\0'; i++)
@@ -520,7 +520,7 @@ add_cmd_char(c)
{
if (currtable->pbuffer >= currtable->buffer + MAX_USERCMD)
{
- error("too many commands");
+ error("too many commands", NULL_PARG);
exit(1);
}
*(currtable->pbuffer)++ = c;
@@ -620,16 +620,18 @@ findaction(actname)
for (i = 0; currtable->names[i].cn_name != NULL; i++)
if (strcmp(currtable->names[i].cn_name, actname) == 0)
return (currtable->names[i].cn_action);
- error("unknown action");
+ error("unknown action", NULL_PARG);
return (A_INVALID);
}
void
-error(s)
+error(s, parg)
char *s;
+ PARG *parg;
{
fprintf(stderr, "line %d: %s\n", linenum, s);
errors++;
+ (void) parg;
}
@@ -652,7 +654,7 @@ parse_cmdline(p)
s = tstr(&p, 1);
cmdlen += (int) strlen(s);
if (cmdlen > MAX_CMDLEN)
- error("command too long");
+ error("command too long", NULL_PARG);
else
add_cmd_str(s);
} while (*p != ' ' && *p != '\t' && *p != '\0');
@@ -669,7 +671,7 @@ parse_cmdline(p)
p = skipsp(p);
if (*p == '\0')
{
- error("missing action");
+ error("missing action", NULL_PARG);
return;
}
actname = p;
@@ -722,7 +724,7 @@ parse_varline(p)
p = skipsp(p);
if (*p++ != '=')
{
- error("missing =");
+ error("missing =", NULL_PARG);
return;
}