summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenis Vlasenko2008-08-28 22:59:23 +0000
committerDenis Vlasenko2008-08-28 22:59:23 +0000
commit996a61475a7204f17dbaa1960b123b1233027f0f (patch)
tree178f036c99eed15bcbf2f395d04ab757261e3838 /editors
parentd66aa3c701ffb83343239e71a8b294407ff5df86 (diff)
downloadbusybox-996a61475a7204f17dbaa1960b123b1233027f0f.zip
busybox-996a61475a7204f17dbaa1960b123b1233027f0f.tar.gz
awk: support hex constants
Diffstat (limited to 'editors')
-rw-r--r--editors/awk.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/editors/awk.c b/editors/awk.c
index 571d681..19f4840 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;