From 24a57029937207c4fa2ff4acb5a4e1ae1dc9e54b Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 1 Jul 2013 21:19:30 -0400 Subject: Add PROCINFO["errno"] and errno extension to map between errno and strings. --- eval.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'eval.c') diff --git a/eval.c b/eval.c index cf2264bf..c1253f57 100644 --- a/eval.c +++ b/eval.c @@ -997,6 +997,7 @@ update_ERRNO_int(int errcode) { char *cp; + update_PROCINFO_num("errno", errcode); if (errcode) { cp = strerror(errcode); cp = gettext(cp); @@ -1020,6 +1021,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); } -- cgit v1.2.3 From 1f647aac9fa3e412c63a966535de8ee4fec855f2 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Tue, 2 Jul 2013 12:20:56 -0400 Subject: Enhance getline to return -2 when an I/O operation should be retried. --- eval.c | 1 + 1 file changed, 1 insertion(+) (limited to 'eval.c') diff --git a/eval.c b/eval.c index c1253f57..4ad5afe0 100644 --- a/eval.c +++ b/eval.c @@ -1012,6 +1012,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)); } -- cgit v1.2.3 From e3f20c041c078eacf648af94d9f012e4906359bb Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 6 Nov 2014 14:18:37 -0500 Subject: Enhance get_file API to return info about input and output and to enable extensions to create already-opened files or sockets. --- eval.c | 1 - 1 file changed, 1 deletion(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index e7a346d3..2c8d3064 100644 --- a/eval.c +++ b/eval.c @@ -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); -- cgit v1.2.3 From 8b863f8852067b0638e09dc7c82355b96381dc12 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 15 Nov 2014 18:35:45 +0200 Subject: Remove MBS_SUPPORT ifdefs. --- eval.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 0d6a07b6..82b11719 100644 --- a/eval.c +++ b/eval.c @@ -530,7 +530,7 @@ posix_compare(NODE *s1, NODE *s2) * In either case, ret will be the right thing to return. */ } -#if MBS_SUPPORT +#if ! defined(__DJGPP__) else { /* Similar logic, using wide characters */ (void) force_wstring(s1); @@ -610,15 +610,14 @@ cmp_nodes(NODE *t1, NODE *t2) const unsigned char *cp1 = (const unsigned char *) t1->stptr; const unsigned char *cp2 = (const unsigned char *) t2->stptr; -#if MBS_SUPPORT if (gawk_mb_cur_max > 1) { ret = strncasecmpmbs((const unsigned char *) cp1, (const unsigned char *) cp2, l); - } else -#endif - /* Could use tolower() here; see discussion above. */ - for (ret = 0; l-- > 0 && ret == 0; cp1++, cp2++) - ret = casetable[*cp1] - casetable[*cp2]; + } else { + /* Could use tolower() here; see discussion above. */ + for (ret = 0; l-- > 0 && ret == 0; cp1++, cp2++) + ret = casetable[*cp1] - casetable[*cp2]; + } } else ret = memcmp(t1->stptr, t2->stptr, l); -- cgit v1.2.3 From 1736b4db53dc60f1e7a9659dc201e0562d43aa02 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Thu, 5 Feb 2015 09:53:05 -0500 Subject: Setting -v IGNORECASE=0 on the command line should now work properly. --- eval.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 82b11719..2ba79956 100644 --- a/eval.c +++ b/eval.c @@ -707,6 +707,8 @@ set_IGNORECASE() load_casetable(); if (do_traditional) IGNORECASE = false; + else if ((n->flags & (NUMCUR|NUMBER)) != 0) + IGNORECASE = ! iszero(n); else if ((n->flags & (STRING|STRCUR)) != 0) { if ((n->flags & MAYBE_NUM) == 0) { (void) force_string(n); @@ -715,9 +717,7 @@ set_IGNORECASE() (void) force_number(n); IGNORECASE = ! iszero(n); } - } else if ((n->flags & (NUMCUR|NUMBER)) != 0) - IGNORECASE = ! iszero(n); - else + } else IGNORECASE = false; /* shouldn't happen */ set_RS(); /* set_RS() calls set_FS() if need be, for us */ -- cgit v1.2.3 From 2ee1a928483f4fe4f594aebc5c1f8da1253c28b9 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 31 Mar 2015 06:23:04 +0300 Subject: Further improvements. sub/gsub working. --- eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 2ba79956..5f66763a 100644 --- a/eval.c +++ b/eval.c @@ -1180,7 +1180,7 @@ r_get_lhs(NODE *n, bool reference) /* r_get_field --- get the address of a field node */ -static inline NODE ** +NODE ** r_get_field(NODE *n, Func_ptr *assign, bool reference) { long field_num; -- cgit v1.2.3