diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-26 10:29:16 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-09-26 10:29:16 -0700 |
commit | a697c39d79fab4bdebfc37562da454cb3fe55fd4 (patch) | |
tree | eb3701f05ea5716ee86d98085590abb526271ebe /src | |
parent | ebfb4a9f2d9735f74e0c65dc1771849bbe178b63 (diff) | |
parent | 5f726b5af429df683398c454f6cbd0f97228a9d5 (diff) |
Merge pull request #1669 from ngld/fix-sscanf-whitespace
Fix #1668: whiteSpace in _scanString should use only char codes as keys
Diffstat (limited to 'src')
-rw-r--r-- | src/library.js | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/library.js b/src/library.js index a0115373..326369c5 100644 --- a/src/library.js +++ b/src/library.js @@ -1660,12 +1660,6 @@ LibraryManager.library = { __scanString.whiteSpace[{{{ charCode('\v') }}}] = 1; __scanString.whiteSpace[{{{ charCode('\f') }}}] = 1; __scanString.whiteSpace[{{{ charCode('\r') }}}] = 1; - __scanString.whiteSpace[' '] = 1; - __scanString.whiteSpace['\t'] = 1; - __scanString.whiteSpace['\n'] = 1; - __scanString.whiteSpace['\v'] = 1; - __scanString.whiteSpace['\f'] = 1; - __scanString.whiteSpace['\r'] = 1; } // Supports %x, %4x, %d.%d, %lld, %s, %f, %lf. // TODO: Support all format specifiers. @@ -1903,7 +1897,7 @@ LibraryManager.library = { break; } fields++; - } else if (format[formatIndex] in __scanString.whiteSpace) { + } else if (format[formatIndex].charCodeAt(0) in __scanString.whiteSpace) { next = get(); while (next in __scanString.whiteSpace) { if (next <= 0) break mainLoop; // End of input. |