aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2016-06-14 16:35:48 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2016-06-14 16:35:48 -0400
commit5826beec258141776469c5fd9b703d52c81a35fb (patch)
tree2d09f31301c392fa15218d5f133a19f4cfdb5fdb /builtin.c
parent56b1798777fe5464014fca3f9744ebdb950b8348 (diff)
downloadegawk-5826beec258141776469c5fd9b703d52c81a35fb.tar.gz
egawk-5826beec258141776469c5fd9b703d52c81a35fb.tar.bz2
egawk-5826beec258141776469c5fd9b703d52c81a35fb.zip
Add a new boolval function to awk.h to make sure we handle this consistently.
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/builtin.c b/builtin.c
index ede02474..4d9e1452 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1928,11 +1928,8 @@ do_strftime(int nargs)
NODE *tmp;
if (nargs == 3) {
- t3 = fixtype(POP_SCALAR());
- if ((t3->flags & NUMBER) != 0)
- do_gmt = ! iszero(t3);
- else
- do_gmt = (t3->stlen > 0);
+ t3 = POP_SCALAR();
+ do_gmt = boolval(t3);
DEREF(t3);
}