shithub: riscv

Download patch

ref: 46008ac6b7181a2ad57946ea8d67b28b7a230b9a
parent: 415b5dfe9b46b0137fe10d279bbb7ed61a162ad6
author: aiju <devnull@localhost>
date: Fri Apr 29 14:11:29 EDT 2016

handle NaN in awk (thanks spew)

--- a/sys/src/cmd/awk/lib.c
+++ b/sys/src/cmd/awk/lib.c
@@ -696,7 +696,7 @@
 	}
 
 	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++;