diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2010-12-21 20:32:46 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2010-12-21 20:32:46 -0200 |
commit | 3f9a19ca94f9238d5ec897d0bf2cdac8eb6d763e (patch) | |
tree | 147a921ebabe79d69212ffacea42b4aa8257b7db | |
parent | 63c05bee71f4aa90a08ec88c4836cae022e3a878 (diff) | |
download | luarocks-3f9a19ca94f9238d5ec897d0bf2cdac8eb6d763e.tar.gz luarocks-3f9a19ca94f9238d5ec897d0bf2cdac8eb6d763e.tar.bz2 luarocks-3f9a19ca94f9238d5ec897d0bf2cdac8eb6d763e.zip |
fix error message
-rw-r--r-- | src/luarocks/search.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/luarocks/search.lua b/src/luarocks/search.lua index 97b86a45..f8188ee5 100644 --- a/src/luarocks/search.lua +++ b/src/luarocks/search.lua | |||
@@ -269,11 +269,11 @@ function find_suitable_rock(query) | |||
269 | if not results then | 269 | if not results then |
270 | return nil, err | 270 | return nil, err |
271 | end | 271 | end |
272 | local first = results and next(results) | 272 | local first = next(results) |
273 | if first and next(results, first) == nil then | 273 | if not first then |
274 | return pick_latest_version(query.name, results[first]) | ||
275 | elseif not first then | ||
276 | return nil, "No results matching query were found." | 274 | return nil, "No results matching query were found." |
275 | elseif not next(results, first) then | ||
276 | return pick_latest_version(query.name, results[first]) | ||
277 | else | 277 | else |
278 | return results | 278 | return results |
279 | end | 279 | end |