From a0ab03d89e0cafbea99f29a0d10134e4f1212785 Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Mon, 15 Jan 2007 16:56:51 +0000 Subject: [PATCH] Encoding directive was ignored for MARC. --- src/config.c | 9 +++++---- src/pazpar2.c | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/config.c b/src/config.c index e440d74..3ceb427 100644 --- a/src/config.c +++ b/src/config.c @@ -1,4 +1,4 @@ -/* $Id: config.c,v 1.12 2007-01-15 04:34:28 quinn Exp $ */ +/* $Id: config.c,v 1.13 2007-01-15 16:56:51 quinn Exp $ */ #include @@ -291,13 +291,16 @@ static struct conf_retrievalprofile *parse_retrievalprofile(xmlNode *node) yaz_log(YLOG_WARN, "Missing name in 'nativesyntax' element"); return 0; } + if (encoding) + r->native_encoding = encoding; if (!strcmp(name, "iso2709")) { r->native_syntax = Nativesyn_iso2709; // Set a few defaults, too r->native_format = Nativeform_marc21; r->native_mapto = Nativemapto_marcxml; - r->native_encoding = "marc-8"; + if (!r->native_encoding) + r->native_encoding = "marc-8"; setup_marc(r); } else if (!strcmp(name, "xml")) @@ -317,8 +320,6 @@ static struct conf_retrievalprofile *parse_retrievalprofile(xmlNode *node) return 0; } } - if (encoding) - r->native_encoding = encoding; if (mapto) { if (!strcmp(mapto, "marcxml")) diff --git a/src/pazpar2.c b/src/pazpar2.c index fee61ee..2222679 100644 --- a/src/pazpar2.c +++ b/src/pazpar2.c @@ -1,4 +1,4 @@ -/* $Id: pazpar2.c,v 1.31 2007-01-15 05:40:24 quinn Exp $ */ +/* $Id: pazpar2.c,v 1.32 2007-01-15 16:56:51 quinn Exp $ */ #include #include @@ -364,6 +364,8 @@ static void add_facet(struct session *s, const char *type, const char *value) { int i; + if (!*value) + return; for (i = 0; i < s->num_termlists; i++) if (!strcmp(s->termlists[i].name, type)) break; -- 1.7.10.4