Changeset

114:3ee83c4801b4

clix.archive: Fix pagination message, rsm.first is a table
author Kim Alvefur <zash@zash.se>
date Tue, 09 Jul 2013 14:27:02 +0200
parents 113:1aaf30b457a0
children 115:c6b5d2039f25
files clix/archive.lua
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/clix/archive.lua	Mon Jul 08 13:15:07 2013 +0200
+++ b/clix/archive.lua	Tue Jul 09 14:27:02 2013 +0200
@@ -56,7 +56,13 @@
 					conn:query_archive(opts.to, opts, handle_results);
 					return
 				else
-					conn:info("Next page: --%s=%s", reverse and "before" or "after", result[reverse and "first" or "last"]);
+					local whatnext, nextpage = reverse and "before" or "after";
+					if reverse then
+						nextpage = result.first and result.first[1];
+					else
+						nextpage = result.last;
+				end
+					conn:info("Next page: --%s=%s", whatnext, nextpage);
 				end
 			end
 			conn:close();