From 5b412ea4edbe0a5f084a60ecd1c5479768bc233e Mon Sep 17 00:00:00 2001 From: Norman Clarke Date: Mon, 9 Jul 2012 01:26:55 -0300 Subject: Fix mode string in call to io.open On 5.2, Luarocks fails when installing some rocks with the following error: invalid mode 'wb+' (should match '[rwa]%+?b?') This does not happen on 5.1; I suspect 5.2 may be stricter about validating the mode string. The docs for 5.1 suggest the 'b' must always come at the end: > The mode string can also have a 'b' at the end (http://www.lua.org/manual/5.1/manual.html#pdf-io.open) --- src/luarocks/fs/lua.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua index 67c3ce0f..09175758 100644 --- a/src/luarocks/fs/lua.lua +++ b/src/luarocks/fs/lua.lua @@ -247,7 +247,7 @@ function copy(src, dest, perms) if not perms then perms = fs.get_permissions(src) end local src_h, err = io.open(src, "rb") if not src_h then return nil, err end - local dest_h, err = io.open(dest, "wb+") + local dest_h, err = io.open(dest, "w+b") if not dest_h then src_h:close() return nil, err end while true do local block = src_h:read(8192) -- cgit v1.2.3-55-g6feb