awk: support hex constants

This commit is contained in:
Denis Vlasenko 2008-08-28 22:59:23 +00:00
parent d66aa3c701
commit 996a61475a

View File

@ -973,7 +973,12 @@ static uint32_t next_token(uint32_t expected)
} else if (*p == '.' || isdigit(*p)) { } else if (*p == '.' || isdigit(*p)) {
/* it's a number */ /* 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 == '.') if (*p == '.')
syntax_error(EMSG_UNEXP_TOKEN); syntax_error(EMSG_UNEXP_TOKEN);
tc = TC_NUMBER; tc = TC_NUMBER;