diff options
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -25,7 +25,6 @@ #include "awk.h" -extern void after_beginfile(IOBUF **curfile); extern double pow(double x, double y); extern double modf(double x, double *yp); extern double fmod(double x, double y); @@ -362,6 +361,7 @@ static struct optypetab { { "Op_after_beginfile", NULL }, { "Op_after_endfile", NULL }, { "Op_func", NULL }, + { "Op_comment", NULL }, { "Op_exec_count", NULL }, { "Op_breakpoint", NULL }, { "Op_lint", NULL }, @@ -827,9 +827,9 @@ set_OFS() new_ofs_len = OFS_node->var_value->stlen; if (OFS == NULL) - emalloc(OFS, char *, new_ofs_len + 2, "set_OFS"); + emalloc(OFS, char *, new_ofs_len + 1, "set_OFS"); else if (OFSlen < new_ofs_len) - erealloc(OFS, char *, new_ofs_len + 2, "set_OFS"); + erealloc(OFS, char *, new_ofs_len + 1, "set_OFS"); memcpy(OFS, OFS_node->var_value->stptr, OFS_node->var_value->stlen); OFSlen = new_ofs_len; @@ -1025,6 +1025,7 @@ update_ERRNO_int(int errcode) { char *cp; + update_PROCINFO_num("errno", errcode); if (errcode) { cp = strerror(errcode); cp = gettext(cp); @@ -1039,6 +1040,7 @@ update_ERRNO_int(int errcode) void update_ERRNO_string(const char *string) { + update_PROCINFO_num("errno", 0); unref(ERRNO_node->var_value); ERRNO_node->var_value = make_string(string, strlen(string)); } @@ -1048,6 +1050,7 @@ update_ERRNO_string(const char *string) void unset_ERRNO(void) { + update_PROCINFO_num("errno", 0); unref(ERRNO_node->var_value); ERRNO_node->var_value = dupnode(Nnull_string); } |