From: Denis Vlasenko Date: Thu, 28 Aug 2008 22:59:23 +0000 (-0000) Subject: awk: support hex constants X-Git-Tag: 1_13_0~219 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=996a61475a7204f17dbaa1960b123b1233027f0f;p=oweals%2Fbusybox.git awk: support hex constants --- diff --git a/editors/awk.c b/editors/awk.c index 571d68193..19f48401e 100644 --- a/editors/awk.c +++ b/editors/awk.c @@ -973,7 +973,12 @@ static uint32_t next_token(uint32_t expected) } else if (*p == '.' || isdigit(*p)) { /* it's a number */ - t_double = strtod(p, &p); +#if ENABLE_DESKTOP + if (p[0] == '0' && (p[1] | 0x20) == 'x') + t_double = strtoll(p, &p, 0); + else +#endif + t_double = strtod(p, &p); if (*p == '.') syntax_error(EMSG_UNEXP_TOKEN); tc = TC_NUMBER;