aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-07-15 21:29:59 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-07-15 21:29:59 -0700
commitd8f3b43e24bf15b6696a705e0822a0dd53de74fe (patch)
treeb6bf58c1b1489541e0e02774a17a1c34384bcba8 /src/library.js
parentf1d11329a4d309682f0deb5c4cb2671fea8c9c00 (diff)
remove whitespace at beginning of sscanf, fixes #512
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index 6403c1fd..0c6c7a63 100644
--- a/src/library.js
+++ b/src/library.js
@@ -2282,6 +2282,14 @@ LibraryManager.library = {
var fields = 0;
var argIndex = 0;
var next;
+ // remove initial whitespace
+ while (1) {
+ next = get();
+ if (next == 0) return 0;
+ if (!(next in __scanString.whiteSpace)) break;
+ }
+ unget();
+ next = 1;
for (var formatIndex = 0; formatIndex < format.length; formatIndex++) {
if (next <= 0) return fields;
var next = get();