r8397: merged an upstream fix for the expression bug tpot found yesterday
authorAndrew Tridgell <tridge@samba.org>
Tue, 12 Jul 2005 23:49:08 +0000 (23:49 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:20:14 +0000 (13:20 -0500)
(This used to be commit 93712dd894b4ddaa2281034c754c0fa15f5ec34c)

source4/lib/ejs/ejsLex.c

index 6dcc1c7b784117c6f7fe016d986a3898924eaee8..a5f15c297955c114f559f12dc7e1bb110a6e84a0 100644 (file)
@@ -663,11 +663,11 @@ static int getLexicalToken(Ejs *ep, int state)
                                        break;
                                }
 #if BLD_FEATURE_FLOATING_POINT
-                               if (c == '.' || tolower(c) == 'e' || c == '+' || c == '-') {
+                               if (c == '.' || tolower(c) == 'e' || tolower(c) == 'f') {
                                        type = MPR_TYPE_FLOAT;
                                }
-                       } while (isdigit(c) || c == '.' || tolower(c) == 'e' ||
-                               c == '+' || c == '-');
+                       } while (isdigit(c) || c == '.' || tolower(c) == 'e' || tolower(c) == 'f' ||
+                               ((type == MPR_TYPE_FLOAT) && (c == '+' || c == '-')));
 #else
                        } while (isdigit(c));
 #endif