From feac49c13b36ec885f73151dea6aee4e4b439cdc Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 23 Apr 2012 16:54:08 +0200 Subject: bugfix: number conversion in expression evaluation was not always correct was invalid when the property was no string. Currently all props are strings, so this bug never could hit in practice. --- grammar/rainerscript.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'grammar/rainerscript.c') diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index d1d64e6e..320e66d0 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -743,9 +743,11 @@ var2Number(struct var *r, int *bSuccess) if(r->datatype == 'S') { n = es_str2num(r->d.estr, bSuccess); } else { - *bSuccess = 1; + n = r->d.n; + if(bSuccess) + *bSuccess = 1; } - return r->d.n; + return n; } /* ensure that retval is a string; if string is no number, -- cgit v1.2.3