diff options
-rw-r--r-- | src/library.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js index dcd1e22c..1a4dba67 100644 --- a/src/library.js +++ b/src/library.js @@ -1467,8 +1467,11 @@ LibraryManager.library = { return -1; } } else { + var ungotSize = stream.ungotten.length; bytesRead = _pread(fildes, buf, nbyte, stream.position); - if (bytesRead != -1) stream.position += bytesRead; + if (bytesRead != -1) { + stream.position += (stream.ungotten.length - ungotSize) + bytesRead; + } return bytesRead; } } |