From e869d7fa700129caf7fe8f05cb82116102b4b767 Mon Sep 17 00:00:00 2001 From: WXY Date: Mon, 21 Sep 2015 14:52:05 +0800 Subject: Update tar.lua fix a bug occured when unrar some .tar files using this module --- src/luarocks/tools/tar.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/luarocks/tools/tar.lua b/src/luarocks/tools/tar.lua index 03f7de3c..47f3de28 100644 --- a/src/luarocks/tools/tar.lua +++ b/src/luarocks/tools/tar.lua @@ -31,9 +31,10 @@ local function octal_to_number(octal) local number = 0 for i = #octal,1,-1 do local digit = tonumber(octal:sub(i,i)) - if not digit then break end - number = number + (digit * 8^exp) - exp = exp + 1 + if digit then + number = number + (digit * 8^exp) + exp = exp + 1 + end end return number end -- cgit v1.2.3-55-g6feb