From: Adam Dickmeiss Date: Mon, 10 Sep 2012 10:55:22 +0000 (+0200) Subject: CCL: s=ag automatically adds s=pw X-Git-Tag: v4.2.38~6 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=3e9991341defe84826dbb663400c2b434ef03641;p=yaz-moved-to-github.git CCL: s=ag automatically adds s=pw Apply structure=word/phrase for ag. It really makes no sense to not apply them. --- diff --git a/src/cclfind.c b/src/cclfind.c index 51f06c4..f7903fe 100644 --- a/src/cclfind.c +++ b/src/cclfind.c @@ -462,13 +462,11 @@ static struct ccl_rpn_node *search_term_x(CCL_parser cclp, } } } - /* len now holds the number of characters in the RPN term */ - /* no holds the number of CCL tokens (1 or more) */ - - if (structure_value == -1 && - qual_val_type(qa, CCL_BIB1_STR, CCL_BIB1_STR_WP, &attset)) - { /* no structure attribute met. Apply either structure attribute - WORD or PHRASE depending on number of CCL tokens */ + if (structure_value == -1 && ( + auto_group || + qual_val_type(qa, CCL_BIB1_STR, CCL_BIB1_STR_WP, &attset)) + ) + { if (!is_phrase) ccl_add_attr_numeric(p, attset, CCL_BIB1_STR, 2); else diff --git a/test/test_ccl.c b/test/test_ccl.c index 5b5d571..4cc8423 100644 --- a/test/test_ccl.c +++ b/test/test_ccl.c @@ -86,7 +86,7 @@ void tst1(int pass) ccl_qual_fitem(bibset, "r=o", "x"); ccl_qual_fitem(bibset, "dc.title", "title"); ccl_qual_fitem(bibset, "term dc.title", "comb"); - ccl_qual_fitem(bibset, "s=ag,pw", "ag"); + ccl_qual_fitem(bibset, "s=ag", "ag"); break; case 1: strcpy(tstline, "ti u=4 s=pw t=l,r"); @@ -116,7 +116,7 @@ void tst1(int pass) strcpy(tstline, "comb term dc.title # combination"); ccl_qual_line(bibset, tstline); - strcpy(tstline, "ag s=ag,pw"); + strcpy(tstline, "ag s=ag"); ccl_qual_line(bibset, tstline); break; case 2: @@ -130,7 +130,7 @@ void tst1(int pass) "x r=o\n" "title dc.title\n" "comb term dc.title\n" - "ag s=ag,pw\n" + "ag s=ag\n" ); break; case 3: @@ -175,7 +175,7 @@ void tst1(int pass) " \n" " \n" " \n" - " \n" + " \n" " \n" "\n";