summary refs log tree commit diff
path: root/search.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--search.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/search.c b/search.c
index 67ce79c..d2bd4ca 100644
--- a/search.c
+++ b/search.c
@@ -78,12 +78,12 @@ enum kcgi_err searchPage(struct kreq *req) {
 	struct khtmlreq html;
 	error = error
 		|| khtml_open(&html, req, 0)
-		|| htmlHead(&html, query)
+		|| htmlHead(&html, req, query)
 		|| htmlNav(&html, req)
 		|| khtml_elem(&html, KELEM_TABLE);
 	if (error) return error;
 
-	if (offset) {
+	if (offset && !req->fieldmap[Export]) {
 		int64_t prev = offset - eventsLimit;
 		char *href = offsetURL(network, context, query, (prev > 0 ? prev : 0));
 		error = 0
@@ -128,11 +128,11 @@ enum kcgi_err searchPage(struct kreq *req) {
 			|| khtml_attr(&html, KELEM_TR, KATTR_CLASS, "error", KATTR__MAX)
 			|| khtml_elem(&html, KELEM_TH)
 			|| khtml_puts(&html, sqlite3_errmsg(db))
-			|| htmlFooter(&html)
+			|| htmlFooter(&html, req)
 			|| khtml_close(&html);
 	}
 
-	if (rows == eventsLimit) {
+	if (rows == eventsLimit && !req->fieldmap[Export]) {
 		char *href = offsetURL(network, context, query, offset + eventsLimit);
 		error = 0
 			|| khtml_attr(&html, KELEM_TR, KATTR_CLASS, "page", KATTR__MAX)
@@ -152,5 +152,5 @@ enum kcgi_err searchPage(struct kreq *req) {
 		if (error) return error;
 	}
 
-	return htmlFooter(&html) || khtml_close(&html);
+	return htmlFooter(&html, req) || khtml_close(&html);
 }