Encoding directive was ignored for MARC.
authorSebastian Hammer <quinn@indexdata.com>
Mon, 15 Jan 2007 16:56:51 +0000 (16:56 +0000)
committerSebastian Hammer <quinn@indexdata.com>
Mon, 15 Jan 2007 16:56:51 +0000 (16:56 +0000)
src/config.c
src/pazpar2.c

index e440d74..3ceb427 100644 (file)
@@ -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 <string.h>
 
@@ -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"))
index fee61ee..2222679 100644 (file)
@@ -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 <stdlib.h>
 #include <stdio.h>
@@ -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;