record_render: allow ws after = in typespec
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 20 Jun 2012 13:36:25 +0000 (15:36 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 20 Jun 2012 13:36:25 +0000 (15:36 +0200)
For example, xml; charset= marc-8

src/record_render.c

index 69a208b..1c8c06a 100644 (file)
@@ -367,6 +367,8 @@ const char *yaz_record_render(Z_NamePlusRecord *npr, const char *schema,
         {
             size_t j = 0;
             i = i + 8; /* skip charset= */
+            while (cp[i] == ' ')
+                i++;
             for (j = 0; cp[i] && cp[i] != ';' && cp[i] != ' '; i++)
             {
                 if (j < sizeof(charset)-1)
@@ -378,6 +380,8 @@ const char *yaz_record_render(Z_NamePlusRecord *npr, const char *schema,
         {
             size_t j = 0; 
             i = i + 7;
+            while (cp[i] == ' ')
+                i++;
             for (j = 0; cp[i] && cp[i] != ';' && cp[i] != ' '; i++)
             {
                 if (j < sizeof(format)-1)
@@ -389,7 +393,8 @@ const char *yaz_record_render(Z_NamePlusRecord *npr, const char *schema,
         {
             size_t i0;
             i = i + 7;
-
+            while (cp[i] == ' ')
+                i++;
             i0 = i;
             while (cp[i] && cp[i] != ';')
                 i++;