From badc6391cc7169540e1a063a311adf3c649a6360 Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Wed, 16 May 2007 17:16:21 +0000 Subject: [PATCH] pz:cclmap:* settings were not recognized by settings/init command --- src/logic.c | 9 +++++++-- src/settings.c | 4 ++-- src/settings.h | 3 ++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/logic.c b/src/logic.c index b484279..f54b303 100644 --- a/src/logic.c +++ b/src/logic.c @@ -1,4 +1,4 @@ -/* $Id: logic.c,v 1.28 2007-05-14 08:01:39 marc Exp $ +/* $Id: logic.c,v 1.29 2007-05-16 17:16:21 quinn Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -559,13 +559,18 @@ void session_apply_setting(struct session *se, char *dbname, char *setting, { struct session_database *sdb = find_session_database(se, dbname); struct setting *new = nmem_malloc(se->session_nmem, sizeof(*new)); - int offset = settings_offset(setting); + int offset = settings_offset_cprefix(setting); if (offset < 0) { yaz_log(YLOG_WARN, "Unknown setting %s", setting); return; } + if (offset == PZ_ID) + { + yaz_log(YLOG_WARN, "No need to set pz:id setting. Ignoring"); + return; + } new->precedence = 0; new->target = dbname; new->name = setting; diff --git a/src/settings.c b/src/settings.c index 449f7a0..e0ef312 100644 --- a/src/settings.c +++ b/src/settings.c @@ -1,4 +1,4 @@ -/* $Id: settings.c,v 1.20 2007-04-23 09:06:20 marc Exp $ +/* $Id: settings.c,v 1.21 2007-05-16 17:16:21 quinn Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -91,7 +91,7 @@ int settings_offset(const char *name) // Ignores everything after second colon, if present // A bit of a hack to support the pz:cclmap: scheme (and more to come?) -static int settings_offset_cprefix(const char *name) +int settings_offset_cprefix(const char *name) { const char *p; int maxlen = 100; diff --git a/src/settings.h b/src/settings.h index fda7bc0..abc784b 100644 --- a/src/settings.h +++ b/src/settings.h @@ -1,4 +1,4 @@ -/* $Id: settings.h,v 1.16 2007-04-22 15:07:10 adam Exp $ +/* $Id: settings.h,v 1.17 2007-05-16 17:16:21 quinn Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -49,6 +49,7 @@ struct setting int settings_num(void); void settings_read(const char *path); int settings_offset(const char *name); +int settings_offset_cprefix(const char *name); void init_settings(void); #endif -- 1.7.10.4