diff options
author | Norman Clarke <norman@njclarke.com> | 2012-07-09 01:26:55 -0300 |
---|---|---|
committer | Norman Clarke <norman@njclarke.com> | 2012-07-09 01:26:55 -0300 |
commit | 5b412ea4edbe0a5f084a60ecd1c5479768bc233e (patch) | |
tree | f0b4106d6e7c3e90ae661032cb6ee9f8e92b8b2e | |
parent | 5e59bbd94683286b4dd232508fa2c2e8ccdc70e0 (diff) | |
download | luarocks-5b412ea4edbe0a5f084a60ecd1c5479768bc233e.tar.gz luarocks-5b412ea4edbe0a5f084a60ecd1c5479768bc233e.tar.bz2 luarocks-5b412ea4edbe0a5f084a60ecd1c5479768bc233e.zip |
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)
-rw-r--r-- | src/luarocks/fs/lua.lua | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
247 | if not perms then perms = fs.get_permissions(src) end | 247 | if not perms then perms = fs.get_permissions(src) end |
248 | local src_h, err = io.open(src, "rb") | 248 | local src_h, err = io.open(src, "rb") |
249 | if not src_h then return nil, err end | 249 | if not src_h then return nil, err end |
250 | local dest_h, err = io.open(dest, "wb+") | 250 | local dest_h, err = io.open(dest, "w+b") |
251 | if not dest_h then src_h:close() return nil, err end | 251 | if not dest_h then src_h:close() return nil, err end |
252 | while true do | 252 | while true do |
253 | local block = src_h:read(8192) | 253 | local block = src_h:read(8192) |