summaryrefslogtreecommitdiff
path: root/source4/lib/appweb/ejs
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-10-15 09:28:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:44:45 -0500
commit5f6a3213e254a9ef178fc756b72badd5823811b2 (patch)
tree48a4305a2d55093a4d235b7af63af11441c3286d /source4/lib/appweb/ejs
parenta59cca6f9796ad44e7899e463b20260da1e78fdb (diff)
downloadsamba-5f6a3213e254a9ef178fc756b72badd5823811b2.tar.gz
samba-5f6a3213e254a9ef178fc756b72badd5823811b2.tar.bz2
samba-5f6a3213e254a9ef178fc756b72badd5823811b2.zip
r11084: - allow hex numbers with 'a'...'f' digits to be parsed
- parse hex numbers correct tridge: how could we submit this to the upstream appweb library? metze (This used to be commit 70cde83c134f2d8bb2f6c0649b7f87a8846e63a4)
Diffstat (limited to 'source4/lib/appweb/ejs')
-rw-r--r--source4/lib/appweb/ejs/ejsLex.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source4/lib/appweb/ejs/ejsLex.c b/source4/lib/appweb/ejs/ejsLex.c
index b4617a638e..b9a363cfc9 100644
--- a/source4/lib/appweb/ejs/ejsLex.c
+++ b/source4/lib/appweb/ejs/ejsLex.c
@@ -633,12 +633,19 @@ static int getLexicalToken(Ejs *ep, int state)
break;
}
if (tolower(c) == 'x') {
- if (tokenAddChar(ep, c) < 0) {
- return EJS_TOK_ERR;
- }
- if ((c = inputGetc(ep)) < 0) {
- break;
- }
+ do {
+ if (tokenAddChar(ep, c) < 0) {
+ return EJS_TOK_ERR;
+ }
+ if ((c = inputGetc(ep)) < 0) {
+ break;
+ }
+ } while (isdigit(c) || (tolower(c) >= 'a' && tolower(c) <= 'f'));
+
+ mprDestroyVar(&ep->tokenNumber);
+ ep->tokenNumber = mprParseVar(ep->token, type);
+ inputPutback(ep, c);
+ return EJS_TOK_NUMBER;
}
if (! isdigit(c)) {
#if BLD_FEATURE_FLOATING_POINT