gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, feature/fixtype, updated. gawk-4.1.0-181


From: Andrew J. Schorr
Subject: [gawk-diffs] [SCM] gawk branch, feature/fixtype, updated. gawk-4.1.0-1817-g56b1798
Date: Tue, 14 Jun 2016 19:30:57 +0000 (UTC)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, feature/fixtype has been updated
       via  56b1798777fe5464014fca3f9744ebdb950b8348 (commit)
      from  e8ba153719506aabfffc911d2519727a3bfc5a36 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=56b1798777fe5464014fca3f9744ebdb950b8348

commit 56b1798777fe5464014fca3f9744ebdb950b8348
Author: Andrew J. Schorr <address@hidden>
Date:   Tue Jun 14 15:30:33 2016 -0400

    Fix strftime 3rd argument to behave like a standard boolean: non-null or 
non-zero.

diff --git a/ChangeLog b/ChangeLog
index a016ca9..87ea189 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2016-06-14         Andrew J. Schorr     <address@hidden>
 
+       * builtin.c (do_strftime): Fix handling of 3rd argument to work
+       as a standard boolean: non-null or non-zero.
+
+2016-06-14         Andrew J. Schorr     <address@hidden>
+
        * gawkapi.c (node_to_awk_value): When caller requests AWK_SCALAR
        or AWK_UNDEFINED, we need to call fixtype before we check the type.
 
diff --git a/builtin.c b/builtin.c
index 90a1fa0..ede0247 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1928,9 +1928,9 @@ do_strftime(int nargs)
                NODE *tmp;
 
                if (nargs == 3) {
-                       t3 = POP_SCALAR();
-                       if ((t3->flags & (NUMCUR|NUMBER)) != 0)
-                               do_gmt = (t3->numbr != 0);
+                       t3 = fixtype(POP_SCALAR());
+                       if ((t3->flags & NUMBER) != 0)
+                               do_gmt = ! iszero(t3);
                        else
                                do_gmt = (t3->stlen > 0);
                        DEREF(t3);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog |    5 +++++
 builtin.c |    6 +++---
 2 files changed, 8 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]