X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ccl%2Fcclsh.c;h=5f1bb83949b3d003b4455d60879c75da9db13338;hb=957e9475ba40602fa1def5f1a6ff5a5b10c7c13c;hp=6a69c9d640b30812db067d5e735b111f18e6c759;hpb=3888e88cde70f36851544ab7acc04e0943470ec6;p=yaz-moved-to-github.git diff --git a/ccl/cclsh.c b/ccl/cclsh.c index 6a69c9d..5f1bb83 100644 --- a/ccl/cclsh.c +++ b/ccl/cclsh.c @@ -45,7 +45,13 @@ * Europagate 1995 * * $Log: cclsh.c,v $ - * Revision 1.2 1996-10-11 15:00:25 adam + * 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 * CCL parser from Europagate Email gateway 1.0. * * Revision 1.11 1995/05/16 09:39:27 adam @@ -108,9 +114,6 @@ int main (int argc, char **argv) { switch (argv[0][1]) { - case 'c': - ccl_case_sensitive = 0; - break; case 'd': debug = 1; break; @@ -152,23 +155,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');