aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index a2ef41a0..5c2c858d 100644
--- a/src/library.js
+++ b/src/library.js
@@ -1831,6 +1831,17 @@ LibraryManager.library = {
} else {
next = get();
var first = true;
+
+ // Strip the optional 0x prefix for %x.
+ if ((type == 'x' || type == 'X') && (next == {{{ charCode('0') }}})) {
+ var peek = get();
+ if (peek == {{{ charCode('x') }}} || peek == {{{ charCode('X') }}}) {
+ next = get();
+ } else {
+ unget();
+ }
+ }
+
while ((curr < max_ || isNaN(max_)) && next > 0) {
if (!(next in __scanString.whiteSpace) && // stop on whitespace
(type == 's' ||