aboutsummaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2019-04-18 20:15:15 +0300
committerArnold D. Robbins <arnold@skeeve.com>2019-04-18 20:15:15 +0300
commit9abeda33e7ce111a266d5e3ec4dafe65c26d5cd0 (patch)
tree68694f00d403866a7d64c606b93db56155aaf56f /command.c
parent33218616b4987c7afd860d0b3f4dad9cdb703547 (diff)
downloadegawk-9abeda33e7ce111a266d5e3ec4dafe65c26d5cd0.tar.gz
egawk-9abeda33e7ce111a266d5e3ec4dafe65c26d5cd0.tar.bz2
egawk-9abeda33e7ce111a266d5e3ec4dafe65c26d5cd0.zip
Fix core dump upon syntax error.
Diffstat (limited to 'command.c')
-rw-r--r--command.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/command.c b/command.c
index 16c99673..87211ee7 100644
--- a/command.c
+++ b/command.c
@@ -94,7 +94,7 @@ static bool want_nodeval = false;
static int cmd_idx = -1; /* index of current command in cmd table */
static int repeat_idx = -1; /* index of last repeatable command in command table */
static CMDARG *arg_list = NULL; /* list of arguments */
-static long errcount = 0;
+static long dbg_errcount = 0;
static char *lexptr_begin = NULL;
static bool in_commands = false;
static int num_dim;
@@ -1553,7 +1553,7 @@ yyreduce:
case 5:
#line 130 "command.y" /* yacc.c:1652 */
{
- if (errcount == 0 && cmd_idx >= 0) {
+ if (dbg_errcount == 0 && cmd_idx >= 0) {
Func_cmd cmdfunc;
bool terminate = false;
CMDARG *args;
@@ -1621,7 +1621,7 @@ yyreduce:
case 23:
#line 219 "command.y" /* yacc.c:1652 */
{
- if (errcount == 0) {
+ if (dbg_errcount == 0) {
/* don't free arg_list; passed on to statement_list
* non-terminal (empty rule action). See below.
*/
@@ -1788,7 +1788,7 @@ yyreduce:
if (yyvsp[0] != NULL)
num = yyvsp[0]->a_int;
- if (errcount != 0)
+ if (dbg_errcount != 0)
;
else if (in_commands)
yyerror(_("Can't use command `commands' for breakpoint/watchpoint commands"));
@@ -2774,7 +2774,7 @@ yyerror(const char *mesg, ...)
vfprintf(out_fp, mesg, args);
fprintf(out_fp, "\n");
va_end(args);
- errcount++;
+ dbg_errcount++;
repeat_idx = -1;
}
@@ -2796,9 +2796,9 @@ yylex(void)
yylval = (CMDARG *) NULL;
- if (errcount > 0 && lexptr_begin == NULL) {
+ if (dbg_errcount > 0 && lexptr_begin == NULL) {
/* fake a new line */
- errcount = 0;
+ dbg_errcount = 0;
return '\n';
}