X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ccl%2Fcclsh.c;h=0902419121ac4bc314aec046b5d4694e2b45c45b;hb=62bcf7a811cd3151ac10f93317c9ddfa6b16f539;hp=1e12be6afc4fd859fc7fe6f2ada72018e9fa11a6;hpb=85a2e7affad79fd8bd59b403ba7b5f7867d60523;p=yaz-moved-to-github.git diff --git a/ccl/cclsh.c b/ccl/cclsh.c index 1e12be6..0902419 100644 --- a/ccl/cclsh.c +++ b/ccl/cclsh.c @@ -45,7 +45,13 @@ * Europagate 1995 * * $Log: cclsh.c,v $ - * Revision 1.3 1997-04-30 08:52:07 quinn + * Revision 1.5 1999-12-16 23:36:19 adam + * Implemented ILL protocol. Minor updates ASN.1 compiler. + * + * Revision 1.4 1999/03/31 11:15:37 adam + * Fixed memory leaks in ccl_find_str and ccl_qual_rm. + * + * Revision 1.3 1997/04/30 08:52:07 quinn * Null * * Revision 1.2 1996/10/11 15:00:25 adam @@ -92,7 +98,7 @@ #include #include -#include +#include static int debug = 0; static char *prog; @@ -111,9 +117,6 @@ int main (int argc, char **argv) { switch (argv[0][1]) { - case 'c': - ccl_case_sensitive = 0; - break; case 'd': debug = 1; break; @@ -155,23 +158,31 @@ int main (int argc, char **argv) while (1) { char buf[80]; - int error, pos; + int i, error, pos; struct ccl_rpn_node *rpn; printf ("CCLSH>"); fflush (stdout); if (!fgets (buf, 79, stdin)) break; - rpn = ccl_find_str (bibset, buf, &error, &pos); - if (error) - { - printf ("%*s^ - ", 6+pos, " "); - printf ("%s\n", ccl_err_msg (error)); - } - else + for (i = 0; i<1; i++) { - assert (rpn); - ccl_pr_tree (rpn, stdout); - putchar ('\n'); + rpn = ccl_find_str (bibset, buf, &error, &pos); + if (error) + { + printf ("%*s^ - ", 6+pos, " "); + printf ("%s\n", ccl_err_msg (error)); + } + else + { + assert (rpn); + if (i == 0) + { + ccl_pr_tree (rpn, stdout); + putchar ('\n'); + } + } + if (rpn) + ccl_rpn_delete(rpn); } } putchar ('\n');