1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-03 21:00:04 +02:00

update dependencies

This commit is contained in:
s2
2018-10-09 09:51:34 +02:00
parent 4fcc873901
commit da4083f574
1112 changed files with 23205 additions and 21697 deletions

View File

@@ -1,5 +1,6 @@
var fs = require('fs');
var path = require("path");
var path = require('path');
var alloc = require('buffer-alloc');
var MAX_BYTES = 512;
module.exports = function(bytes, size, cb) {
@@ -13,7 +14,7 @@ module.exports = function(bytes, size, cb) {
fs.open(file, 'r', function(r_err, descriptor){
if (r_err) return cb(r_err);
bytes = new Buffer(MAX_BYTES);
bytes = alloc(MAX_BYTES);
// Read the file with no encoding for raw buffer access.
fs.read(descriptor, bytes, 0, bytes.length, 0, function(err, size, bytes){
fs.close(descriptor, function(c_err){
@@ -116,7 +117,7 @@ module.exports.sync = function(bytes, size) {
var descriptor = fs.openSync(file, 'r');
try {
// Read the file with no encoding for raw buffer access.
bytes = new Buffer(MAX_BYTES);
bytes = alloc(MAX_BYTES);
size = fs.readSync(descriptor, bytes, 0, bytes.length, 0);
} finally {
fs.closeSync(descriptor);