Procházet zdrojové kódy

fix edge case where io.open(whatever):read() returns nil

master
XeonSquared před 10 měsíci
rodič
revize
a33476cf00
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. +1
    -1
      lib/libmtar.lua

+ 1
- 1
lib/libmtar.lua Zobrazit soubor

@@ -24,7 +24,7 @@ end
function mtar.iter(stream) -- table -- function -- Given buffer *stream*, returns an iterator suitable for use with *for* that returns, for each iteration, the file name, a function to read from the file, and the length of the file.
local remain = 0
local function read(n)
local rb = stream:read(math.min(n,remain))
local rb = stream:read(math.min(n,remain)) or ""
remain = remain - rb:len()
return rb
end


Načítá se…
Zrušit
Uložit