aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-08-28 22:59:23 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-08-28 22:59:23 +0000
commit996a61475a7204f17dbaa1960b123b1233027f0f (patch)
tree178f036c99eed15bcbf2f395d04ab757261e3838
parentd66aa3c701ffb83343239e71a8b294407ff5df86 (diff)
downloadbusybox-w32-996a61475a7204f17dbaa1960b123b1233027f0f.tar.gz
busybox-w32-996a61475a7204f17dbaa1960b123b1233027f0f.tar.bz2
busybox-w32-996a61475a7204f17dbaa1960b123b1233027f0f.zip
awk: support hex constants
-rw-r--r--editors/awk.c7
1 files changed, 6 insertions, 1 deletions
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)
973 973
974 } else if (*p == '.' || isdigit(*p)) { 974 } else if (*p == '.' || isdigit(*p)) {
975 /* it's a number */ 975 /* it's a number */
976 t_double = strtod(p, &p); 976#if ENABLE_DESKTOP
977 if (p[0] == '0' && (p[1] | 0x20) == 'x')
978 t_double = strtoll(p, &p, 0);
979 else
980#endif
981 t_double = strtod(p, &p);
977 if (*p == '.') 982 if (*p == '.')
978 syntax_error(EMSG_UNEXP_TOKEN); 983 syntax_error(EMSG_UNEXP_TOKEN);
979 tc = TC_NUMBER; 984 tc = TC_NUMBER;