aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2013-12-22 09:03:18 +0100
committerThijs Schreijer <thijs@thijsschreijer.nl>2013-12-22 09:03:18 +0100
commitdf91dc76f867cc2c79bab1b086a5ed7e607b1d97 (patch)
tree31cd39451ccccbe4905005da571908aee9803b3a
parentc05ebc07763f94c1adfd4c201a805b66e8d98097 (diff)
downloadluarocks-df91dc76f867cc2c79bab1b086a5ed7e607b1d97.tar.gz
luarocks-df91dc76f867cc2c79bab1b086a5ed7e607b1d97.tar.bz2
luarocks-df91dc76f867cc2c79bab1b086a5ed7e607b1d97.zip
Normalizes paths displayed from `search` module, used for searching and listing installed rocks
-rw-r--r--src/luarocks/dir.lua2
-rw-r--r--src/luarocks/search.lua1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/luarocks/dir.lua b/src/luarocks/dir.lua
index 3c7465bb..5174fadc 100644
--- a/src/luarocks/dir.lua
+++ b/src/luarocks/dir.lua
@@ -65,5 +65,5 @@ function split_url(url)
65end 65end
66 66
67function normalize(name) 67function normalize(name)
68 return name:gsub("\\", "/"):gsub("(.)/*$", "%1") 68 return name:gsub("\\", "/"):gsub("(.)/*$", "%1"):gsub("//", "/")
69end 69end
diff --git a/src/luarocks/search.lua b/src/luarocks/search.lua
index 356e06e8..76ea6815 100644
--- a/src/luarocks/search.lua
+++ b/src/luarocks/search.lua
@@ -305,6 +305,7 @@ function print_results(results, porcelain)
305 end 305 end
306 for version, repos in util.sortedpairs(versions, deps.compare_versions) do 306 for version, repos in util.sortedpairs(versions, deps.compare_versions) do
307 for _, repo in ipairs(repos) do 307 for _, repo in ipairs(repos) do
308 repo.repo = dir.normalize(repo.repo)
308 if porcelain then 309 if porcelain then
309 util.printout(package, version, repo.arch, repo.repo) 310 util.printout(package, version, repo.arch, repo.repo)
310 else 311 else