=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/bc/bc.y,v retrieving revision 1.39 retrieving revision 1.40 diff -c -r1.39 -r1.40 *** src/usr.bin/bc/bc.y 2011/08/03 08:48:19 1.39 --- src/usr.bin/bc/bc.y 2011/10/06 14:37:56 1.40 *************** *** 1,5 **** %{ ! /* $OpenBSD: bc.y,v 1.39 2011/08/03 08:48:19 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek --- 1,5 ---- %{ ! /* $OpenBSD: bc.y,v 1.40 2011/10/06 14:37:56 otto Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek *************** *** 944,949 **** --- 944,953 ---- if (yyin != NULL && feof(yyin)) n = asprintf(&str, "%s: %s:%d: %s: unexpected EOF", + __progname, filename, lineno, s); + else if (yytext[0] == '\n') + n = asprintf(&str, + "%s: %s:%d: %s: newline unexpected", __progname, filename, lineno, s); else if (isspace(yytext[0]) || !isprint(yytext[0])) n = asprintf(&str,