Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/yaz
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 25 Sep 2008 08:10:45 +0000 (10:10 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 25 Sep 2008 08:10:45 +0000 (10:10 +0200)
client/client.c

index 4fd9406..106f12d 100644 (file)
@@ -3267,12 +3267,24 @@ int cmd_format(const char *arg)
         printf("Usage: format <recordsyntax>\n");
         return 0;
     }
+    while (sscanf(cp, "%40s%n", form_str, &nor) >= 1 && nor > 0
+           && idx < RECORDSYNTAX_MAX)
+    {
+        if (strcmp(form_str, "none") && 
+            !yaz_string_to_oid_odr(yaz_oid_std(), CLASS_RECSYN, form_str, out))
+        {
+            printf("Bad format: %s\n", form_str);
+            return 0;
+        }
+        cp += nor;
+    }
     for (i = 0; i < recordsyntax_size; i++)
     {
         xfree(recordsyntax_list[i]);
         recordsyntax_list[i] = 0;
     }
-
+    
+    cp = arg;
     while (sscanf(cp, "%40s%n", form_str, &nor) >= 1 && nor > 0
            && idx < RECORDSYNTAX_MAX)
     {