diff options
| author | Philipp Janda <siffiejoe@gmx.net> | 2013-09-26 07:36:39 +0200 |
|---|---|---|
| committer | Philipp Janda <siffiejoe@gmx.net> | 2013-09-26 07:36:39 +0200 |
| commit | f63fa840457558595364eec980082f9ae921d086 (patch) | |
| tree | 430c38cc19ccb674b804aca5ece95a26e53b0505 /src | |
| parent | 9fd70043f8b23b73dbb7c413cbdc79142da99e12 (diff) | |
| parent | 4a3c08701e463aa811b40fe61607d246209c5688 (diff) | |
| download | luarocks-f63fa840457558595364eec980082f9ae921d086.tar.gz luarocks-f63fa840457558595364eec980082f9ae921d086.tar.bz2 luarocks-f63fa840457558595364eec980082f9ae921d086.zip | |
Merge remote-tracking branch 'upstream/master' into linux-multiarch
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/dir.lua | 7 | ||||
| -rw-r--r-- | src/luarocks/persist.lua | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/luarocks/dir.lua b/src/luarocks/dir.lua index b496c962..3c7465bb 100644 --- a/src/luarocks/dir.lua +++ b/src/luarocks/dir.lua | |||
| @@ -17,13 +17,12 @@ end | |||
| 17 | 17 | ||
| 18 | --- Strip the name off a path+filename. | 18 | --- Strip the name off a path+filename. |
| 19 | -- @param pathname string: A path+name, such as "/a/b/c". | 19 | -- @param pathname string: A path+name, such as "/a/b/c". |
| 20 | -- @return string: The filename without its path, such as "/a/b/". | 20 | -- @return string: The filename without its path, such as "/a/b". |
| 21 | -- For entries such as "/a/b/", "/a/" is returned. If there are | 21 | -- For entries such as "/a/b/", "/a" is returned. If there are |
| 22 | -- no directory separators in input, "" is returned. | 22 | -- no directory separators in input, "" is returned. |
| 23 | function dir_name(pathname) | 23 | function dir_name(pathname) |
| 24 | assert(type(pathname) == "string") | 24 | assert(type(pathname) == "string") |
| 25 | 25 | return (pathname:gsub("/*$", ""):match("(.*)[/]+[^/]*")) or "" | |
| 26 | return (pathname:gsub("/*$", ""):match("(.*/)[^/]*")) or "" | ||
| 27 | end | 26 | end |
| 28 | 27 | ||
| 29 | --- Describe a path in a cross-platform way. | 28 | --- Describe a path in a cross-platform way. |
diff --git a/src/luarocks/persist.lua b/src/luarocks/persist.lua index 208aee02..376a242a 100644 --- a/src/luarocks/persist.lua +++ b/src/luarocks/persist.lua | |||
| @@ -20,7 +20,7 @@ function load_into_table(filename, tbl) | |||
| 20 | 20 | ||
| 21 | local result, chunk, ran, err | 21 | local result, chunk, ran, err |
| 22 | local result = tbl or {} | 22 | local result = tbl or {} |
| 23 | if setfenv then -- Lua 5.1 | 23 | if _VERSION == "Lua 5.1" then -- Lua 5.1 |
| 24 | chunk, err = loadfile(filename) | 24 | chunk, err = loadfile(filename) |
| 25 | if chunk then | 25 | if chunk then |
| 26 | setfenv(chunk, result) | 26 | setfenv(chunk, result) |
