diff --git a/ase/awk/awk.h b/ase/awk/awk.h index d2c22c6f..98ff1242 100644 --- a/ase/awk/awk.h +++ b/ase/awk/awk.h @@ -1,5 +1,5 @@ /* - * $Id: awk.h,v 1.194 2007-03-02 11:14:33 bacon Exp $ + * $Id: awk.h,v 1.195 2007-03-02 11:47:52 bacon Exp $ * * {License} */ @@ -200,7 +200,7 @@ enum ASE_AWK_ENOMEM, /* out of memory */ ASE_AWK_ENOSUP, /* not supported */ ASE_AWK_ENOPER, /* operation not allowed */ - ASE_AWK_ENODEV, /* no such device */ + ASE_AWK_ENODEV, /* function '%.*s' not found */ ASE_AWK_ENOSPC, /* no space left on device */ ASE_AWK_ENOENT, /* no such file, directory, or data */ ASE_AWK_EMFILE, /* too many open files */ diff --git a/ase/awk/err.c b/ase/awk/err.c index 701a8e93..4dc48be0 100644 --- a/ase/awk/err.c +++ b/ase/awk/err.c @@ -1,5 +1,5 @@ /* - * $Id: err.c,v 1.76 2007-03-02 11:41:55 bacon Exp $ + * $Id: err.c,v 1.77 2007-03-02 11:47:52 bacon Exp $ * * {License} */ @@ -101,7 +101,7 @@ static const ase_char_t* __geterrstr (int errnum) ASE_T("wrong position index"), ASE_T("too few arguments"), ASE_T("too many arguments"), - ASE_T("no such function"), + ASE_T("function '%.*s' not found"), ASE_T("variable not indexable"), ASE_T("variable '%.*s' not deletable"), ASE_T("value not a map"), diff --git a/ase/awk/run.c b/ase/awk/run.c index e2ec3de0..d07da24a 100644 --- a/ase/awk/run.c +++ b/ase/awk/run.c @@ -1,5 +1,5 @@ /* - * $Id: run.c,v 1.334 2007-03-02 11:14:34 bacon Exp $ + * $Id: run.c,v 1.335 2007-03-02 11:47:52 bacon Exp $ * * {License} */ @@ -5133,35 +5133,13 @@ static ase_awk_val_t* __eval_afn (ase_awk_run_t* run, ase_awk_nde_t* nde) call->what.afn.name.ptr, call->what.afn.name.len); if (pair == ASE_NULL) { - ase_char_t* fmt = ASE_T("function '%.*s' not found"); - ase_char_t* fmt2 = ASE_T("function '%.*s..' not found"); - ase_size_t len = ase_strlen(fmt); - ase_size_t len2 = ase_strlen(fmt2); + ase_cstr_t errarg; - if (len2 < ASE_COUNTOF(run->errmsg) && - call->what.afn.name.len > ASE_COUNTOF(run->errmsg)-len2) - { - run->awk->prmfns.misc.sprintf ( - run->awk->prmfns.misc.custom_data, - run->errmsg, - ASE_COUNTOF(run->errmsg), - fmt2, - ASE_COUNTOF(run->errmsg)-len2, - call->what.afn.name.ptr); - } - else - { - run->awk->prmfns.misc.sprintf ( - run->awk->prmfns.misc.custom_data, - run->errmsg, - ASE_COUNTOF(run->errmsg), - fmt, - call->what.afn.name.len, - call->what.afn.name.ptr); - } + errarg.ptr = call->what.afn.name.ptr; + errarg.len = call->what.afn.name.len, - ase_awk_setrunerror_old ( - run, ASE_AWK_EFNNONE, nde->line, run->errmsg); + ase_awk_setrunerror (run, + ASE_AWK_EFNNONE, nde->line, &errarg, 1); return ASE_NULL; } diff --git a/ase/test/awk/err-006.awk b/ase/test/awk/err-006.awk new file mode 100644 index 00000000..e184c15c --- /dev/null +++ b/ase/test/awk/err-006.awk @@ -0,0 +1,3 @@ +BEGIN { + helpxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxhelphelp (); +}