Guest User

Untitled

a guest
May 26th, 2018
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. commit 2dac1a1a2ed79cbbc9c80d8a10fcdb511c013341
  2. Author: Ryan Dahl <ry@tinyclouds.org>
  3. Date: Thu May 20 15:45:07 2010 -0700
  4.  
  5. fix global var leak
  6.  
  7. diff --git a/lib/fs.js b/lib/fs.js
  8. index fc0843b..3ea6e07 100644
  9. --- a/lib/fs.js
  10. +++ b/lib/fs.js
  11. @@ -147,16 +147,14 @@ fs.read = function (fd, buffer, offset, length, position, callback) {
  12. if (!(buffer instanceof Buffer)) {
  13. // legacy string interface (fd, length, position, encoding, callback)
  14. var cb = arguments[4];
  15. - encoding = arguments[3];
  16. + var encoding = arguments[3];
  17. position = arguments[2];
  18. length = arguments[1];
  19. buffer = new Buffer(length);
  20. offset = 0;
  21.  
  22. callback = function(err, bytesRead) {
  23. - if (!cb) {
  24. - return;
  25. - }
  26. + if (!cb) return;
  27.  
  28. var str = (bytesRead > 0)
  29. ? buffer.toString(encoding, 0, bytesRead)
Add Comment
Please, Sign In to add comment