diff --git a/ase/awk/err.c b/ase/awk/err.c index 97ce3c47..11222062 100644 --- a/ase/awk/err.c +++ b/ase/awk/err.c @@ -1,5 +1,5 @@ /* - * $Id: err.c,v 1.80 2007-03-04 06:26:45 bacon Exp $ + * $Id: err.c,v 1.81 2007-03-04 06:45:43 bacon Exp $ * * {License} */ @@ -53,7 +53,7 @@ static const ase_char_t* __geterrstr (int errnum) ASE_T("cannot switch to next console for write"), ASE_T("cannot write to console"), - ASE_T("invalid character"), + ASE_T("invalid character '%.*s'"), ASE_T("cannot unget character"), ASE_T("unexpected end of source"), diff --git a/ase/awk/parse.c b/ase/awk/parse.c index 02a020c1..f5e9887d 100644 --- a/ase/awk/parse.c +++ b/ase/awk/parse.c @@ -1,5 +1,5 @@ /* - * $Id: parse.c,v 1.249 2007-03-04 06:26:45 bacon Exp $ + * $Id: parse.c,v 1.250 2007-03-04 06:45:43 bacon Exp $ * * {License} */ @@ -4649,12 +4649,14 @@ static int __get_token (ase_awk_t* awk) } else { - awk->prmfns.misc.sprintf ( - awk->prmfns.misc.custom_data, - awk->errmsg, ASE_COUNTOF(awk->errmsg), - ASE_T("invalid character '%c'"), c); - ase_awk_seterror_old ( - awk, ASE_AWK_ELXCHR, awk->token.line, awk->errmsg); + ase_cstr_t errarg; + ase_char_t cc = (ase_char_t)c; + + errarg.ptr = &cc; + errarg.len = 1; + + ase_awk_seterror ( + awk, ASE_AWK_ELXCHR, awk->token.line, &errarg, 1); return -1; } diff --git a/ase/test/awk/err-001.out b/ase/test/awk/err-001.out index d88653da..438c103c 100644 --- a/ase/test/awk/err-001.out +++ b/ase/test/awk/err-001.out @@ -1 +1 @@ -PARSE ERROR: CODE [36] LINE [2] invalid character ' +PARSE ERROR: CODE [36] LINE [2] invalid character ''