From 1adfd06546d823b0e6ac1238e3e96adbbe7abab3 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Mon, 6 Feb 2006 16:14:16 +0000 Subject: [PATCH] Sorting after a "find" works now again SVN revision: 1648 --- src/elogd.c | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 9c816cd2..bf746af5 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -17548,36 +17548,16 @@ void show_elog_list(LOGBOOK * lbs, int past_n, int last_n, int page_n, BOOL defa for (i = 0; i < n_attr_disp; i++) { /* assemble current command line, replace sort statements */ - strcpy(ref, isparam("cmdline") ? getparam("cmdline") : ""); - if (strstr(ref, "&sort=")) { - p = strstr(ref, "&sort=") + 1; - while (*p && *p != '&') - p++; - strcpy(strstr(ref, "&sort="), p); - } - if (strstr(ref, "&rsort=")) { - p = strstr(ref, "&rsort=") + 1; - while (*p && *p != '&') - p++; - strcpy(strstr(ref, "&rsort="), p); - } - if (strstr(ref, "?sort=")) - *strstr(ref, "?sort=") = 0; - if (strstr(ref, "?rsort=")) - *strstr(ref, "?rsort=") = 0; - + strcpy(ref, getparam("cmdline")); + strcpy(str, disp_attr[i]); url_encode(str, sizeof(str)); if (isparam("sort") && strcmp(getparam("sort"), disp_attr[i]) == 0) { - if (strchr(ref, '?')) - sprintf(ref + strlen(ref), "&rsort=%s", str); - else - sprintf(ref + strlen(ref), "?rsort=%s", str); + subst_param(ref, sizeof(ref), "sort", ""); + subst_param(ref, sizeof(ref), "rsort", str); } else { - if (strchr(ref, '?')) - sprintf(ref + strlen(ref), "&sort=%s", str); - else - sprintf(ref + strlen(ref), "?sort=%s", str); + subst_param(ref, sizeof(ref), "rsort", ""); + subst_param(ref, sizeof(ref), "sort", str); } img[0] = 0;