commit 296c76ff3bfb692fddfb107be95c54a3578199b5 parent a83fbb4fa82949acda5b74477e825afe4b5e433e Author: Simon Kornblith <simon@simonster.com> Date: Wed, 9 Feb 2011 22:10:10 +0000 fix xml/e4x mode on very large files Diffstat:
| M | chrome/content/zotero/xpcom/translation/browser_firefox.js | | | 9 | +++++++-- |
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/translation/browser_firefox.js b/chrome/content/zotero/xpcom/translation/browser_firefox.js @@ -313,9 +313,14 @@ Zotero.Translate.IO.Read.prototype = { "_readToString":function() { var str = {}; + var stringBits = []; this.inputStream.QueryInterface(Components.interfaces.nsIUnicharInputStream); - this.inputStream.readString(this.file.fileSize, str); - return str.value; + while(1) { + var read = this.inputStream.readString(32768, str); + if(!read) break; + stringBits.push(str.value); + } + return stringBits.join(""); }, "_initRDF":function() {