diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-04-09 18:04:18 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-04-09 18:04:18 +0300 |
commit | 24ddf2742b0034089bce38e5f4ebd99b93c6e161 (patch) | |
tree | f1bebfcf20d78673b656122b0258c5054a999562 /awkgram.c | |
parent | 9091a155190093c3d2dbbed4bd29b0feec50c8ce (diff) | |
download | egawk-24ddf2742b0034089bce38e5f4ebd99b93c6e161.tar.gz egawk-24ddf2742b0034089bce38e5f4ebd99b93c6e161.tar.bz2 egawk-24ddf2742b0034089bce38e5f4ebd99b93c6e161.zip |
Further fixes from Andrew Schorr.
Diffstat (limited to 'awkgram.c')
-rw-r--r-- | awkgram.c | 16 |
1 files changed, 3 insertions, 13 deletions
@@ -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; |