summaryrefslogtreecommitdiff
path: root/sys/src/cmd/awk
diff options
context:
space:
mode:
authoraiju <devnull@localhost>2016-04-29 18:11:29 +0200
committeraiju <devnull@localhost>2016-04-29 18:11:29 +0200
commit46008ac6b7181a2ad57946ea8d67b28b7a230b9a (patch)
tree361b94ea5ec073ebc857b86c47f4b74d4b87e48d /sys/src/cmd/awk
parent415b5dfe9b46b0137fe10d279bbb7ed61a162ad6 (diff)
handle NaN in awk (thanks spew)
Diffstat (limited to 'sys/src/cmd/awk')
-rw-r--r--sys/src/cmd/awk/lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/cmd/awk/lib.c b/sys/src/cmd/awk/lib.c
index 2d60e3abb..4455bc2a7 100644
--- a/sys/src/cmd/awk/lib.c
+++ b/sys/src/cmd/awk/lib.c
@@ -696,7 +696,7 @@ int is_number(char *s)
}
r = strtod(s, &ep);
- if (ep == s || isInf(r, 1) || isInf(r, -1))
+ if (ep == s || isInf(r, 1) || isInf(r, -1) || isNaN(r))
return 0;
while (*ep == ' ' || *ep == '\t' || *ep == '\n')
ep++;