shithub: neatroff

Download patch

ref: 167ebd7f1339a380fcbb96daa806afcbf438a0ae
parent: ae11bbb7c3e0e8029ce57870e4ebbcd295b60751
author: Ali Gholami Rudi <ali@rudi.ir>
date: Mon Sep 15 06:12:00 EDT 2014

eval: even for "&" and ":", only positive numbers are true

Reported by Carsten Kunze <carsten.kunze@arcor.de>.

--- a/eval.c
+++ b/eval.c
@@ -119,9 +119,9 @@
 		else if (!evaljmp(s, '=') + !evaljmp(s, '='))
 			ret = ret == evalatom(s);
 		else if (!evaljmp(s, '&'))
-			ret = ret && evalatom(s);
+			ret = ret > 0 && evalatom(s) > 0;
 		else if (!evaljmp(s, ':'))
-			ret = ret || evalatom(s);
+			ret = ret > 0 || evalatom(s) > 0;
 		else
 			break;
 	}