diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/dir.lua | 2 | ||||
| -rw-r--r-- | src/luarocks/fs/lua.lua | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/luarocks/dir.lua b/src/luarocks/dir.lua index 5a8058dc..00a9317f 100644 --- a/src/luarocks/dir.lua +++ b/src/luarocks/dir.lua | |||
| @@ -10,7 +10,7 @@ separator = "/" | |||
| 10 | function base_name(pathname) | 10 | function base_name(pathname) |
| 11 | assert(type(pathname) == "string") | 11 | assert(type(pathname) == "string") |
| 12 | 12 | ||
| 13 | local base = pathname:match(".*[/\\]([^/\\]*)") | 13 | local base = pathname:gsub("[/\\]*$", ""):match(".*[/\\]([^/\\]*)") |
| 14 | return base or pathname | 14 | return base or pathname |
| 15 | end | 15 | end |
| 16 | 16 | ||
diff --git a/src/luarocks/fs/lua.lua b/src/luarocks/fs/lua.lua index ce0877db..2a176259 100644 --- a/src/luarocks/fs/lua.lua +++ b/src/luarocks/fs/lua.lua | |||
| @@ -633,7 +633,7 @@ end | |||
| 633 | -- plus an error message. | 633 | -- plus an error message. |
| 634 | function check_command_permissions(flags) | 634 | function check_command_permissions(flags) |
| 635 | local root_dir = path.root_dir(cfg.rocks_dir) | 635 | local root_dir = path.root_dir(cfg.rocks_dir) |
| 636 | if not flags["local"] and not fs.is_writable(root_dir) then | 636 | if not flags["local"] and not (fs.is_writable(root_dir) or fs.is_writable(dir.dir_name(root_dir))) then |
| 637 | return nil, "Your user does not have write permissions in " .. root_dir .. | 637 | return nil, "Your user does not have write permissions in " .. root_dir .. |
| 638 | " \n-- you may want to run as a privileged user or use your local tree with --local." | 638 | " \n-- you may want to run as a privileged user or use your local tree with --local." |
| 639 | end | 639 | end |
