X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=client%2Fclient.c;h=5cce8ccc026901b8d0eaaf37a5db8166ab24c7aa;hb=bc4b50939a936dbb214c783c18a44039ea048fdd;hp=c34d201d56e0c4c0dd76628c24384216b1ceb453;hpb=f59f3bba11d2db2fa291b736a98bf2f9f7e8f6c0;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index c34d201..5cce8cc 100644 --- a/client/client.c +++ b/client/client.c @@ -2136,8 +2136,10 @@ static int cmd_update0(const char *arg) static int cmd_update_Z3950(int version, int action_no, const char *recid, char *rec_buf, int rec_len); +#if YAZ_HAVE_XML2 static int cmd_update_SRW(int action_no, const char *recid, char *rec_buf, int rec_len); +#endif static int cmd_update_common(const char *arg, int version) { @@ -3267,23 +3269,29 @@ int cmd_format(const char *arg) printf("Usage: format \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) { if (!strcmp(form_str, "none")) break; - if (!yaz_string_to_oid_odr(yaz_oid_std(), CLASS_RECSYN, form_str, out)) - { - printf("Bad format: %s\n", form_str); - recordsyntax_size = 0; - return 0; - } recordsyntax_list[idx] = xstrdup(form_str); cp += nor; idx++;