From 5cf2d03ca96bc79b8dfadae7ac0806f594375e7b Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Tue, 7 Feb 2006 07:46:11 +0000 Subject: [PATCH] Strip ANY logbook in new redirection method SVN revision: 1650 --- src/elogd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/elogd.c b/src/elogd.c index 753e46d7..ff3e5d74 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -6190,6 +6190,7 @@ void compose_base_url(LOGBOOK * lbs, char *base_url, int size) void set_location(LOGBOOK * lbs, char *rel_path) { char str[NAME_LENGTH], *p; + int i; /* if path contains http(s), go directly there */ if (strncmp(rel_path, "http://", 7) == 0) { @@ -6229,9 +6230,12 @@ void set_location(LOGBOOK * lbs, char *rel_path) if (*p == '/') p++; - /* if last subdir equals logbook name, strip it */ - if (lbs && stricmp(p, lbs->name_enc) == 0) - *p = 0; + /* if last subdir equals any logbook name, strip it */ + for (i = 0; lb_list[i].name[0]; i++) + if (stricmp(p, lb_list[i].name) == 0) { + *p = 0; + break; + } /* if last subdir equals top group, strip it */ if (!lbs && getcfg_topgroup() && stricmp(p, getcfg_topgroup()) == 0)