aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2015-04-09 18:04:18 +0300
committerArnold D. Robbins <arnold@skeeve.com>2015-04-09 18:04:18 +0300
commit24ddf2742b0034089bce38e5f4ebd99b93c6e161 (patch)
treef1bebfcf20d78673b656122b0258c5054a999562 /awkgram.c
parent9091a155190093c3d2dbbed4bd29b0feec50c8ce (diff)
downloadegawk-24ddf2742b0034089bce38e5f4ebd99b93c6e161.tar.gz
egawk-24ddf2742b0034089bce38e5f4ebd99b93c6e161.tar.bz2
egawk-24ddf2742b0034089bce38e5f4ebd99b93c6e161.zip
Further fixes from Andrew Schorr.
Diffstat (limited to 'awkgram.c')
-rw-r--r--awkgram.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/awkgram.c b/awkgram.c
index 2cc2c549..23213da5 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -4516,7 +4516,6 @@ yyerror(const char *m, ...)
char *buf;
int count;
static char end_of_file_line[] = "(END OF FILE)";
- char save;
print_included_from();
@@ -4544,24 +4543,15 @@ yyerror(const char *m, ...)
bp = thisline + strlen(thisline);
}
- /*
- * Saving and restoring *bp keeps valgrind happy,
- * since the guts of glibc uses strlen, even though
- * we're passing an explict precision. Sigh.
- *
- * 8/2003: We may not need this anymore.
- */
- save = *bp;
- *bp = '\0';
-
msg("%.*s", (int) (bp - thisline), thisline);
- *bp = save;
va_start(args, m);
if (mesg == NULL)
mesg = m;
- count = (bp - thisline) + strlen(mesg) + 1 + 1;
+ count = strlen(mesg) + 1;
+ if (lexptr != NULL)
+ count += (lexeme - thisline) + 2;
emalloc(buf, char *, count, "yyerror");
bp = buf;