From e4edb9aff778c683d81892cca705013dbe5dcc58 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 18 Nov 2009 21:18:45 -0800 Subject: Fix total breakage of yyerror and yyerrorf. --- ChangeLog | 7 +++++++ parser.l | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 16d8ddd6..883e35c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-11-18 Kaz Kylheku + + parser.l (yyerror): Total breakage: can't take auto_str of char * + string. + (yyerrorf): Total breakage: arguments of wrong types. Detected + by vformat as garbage. + 2009-11-18 Kaz Kylheku txr.1: Clarified handling of UTF-8, now that it's precise and portable. diff --git a/parser.l b/parser.l index 332b6fc4..32216967 100644 --- a/parser.l +++ b/parser.l @@ -67,7 +67,7 @@ int errors; void yyerror(const char *s) { - yyerrorf(lit("~a"), auto_str(s), nao); + yyerrorf(lit("~a"), string_utf8(s), nao); } void yyerrorf(obj_t *fmt, ...) @@ -75,7 +75,8 @@ void yyerrorf(obj_t *fmt, ...) if (opt_loglevel >= 1) { va_list vl; va_start (vl, fmt); - format(std_error, lit("~a: (~a:~a): "), progname, spec_file, lineno); + format(std_error, lit("~a: (~a:~a): "), prog_string, + spec_file_str, num(lineno), nao); vformat(std_error, fmt, vl); put_char(std_error, chr('\n')); va_end (vl); -- cgit v1.2.3