X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fpquery.c;h=3b416bb01cc5ec17f0dc0fd37d5dd7c46b9c613f;hb=d2f977c26e0b16c544b69339c34ca9300b55b749;hp=63aa7b9a133d2a09841f600c678e0472328c74ee;hpb=b393fdf5e78549672d42e5292f99697c9d0feb76;p=yaz-moved-to-github.git diff --git a/src/pquery.c b/src/pquery.c index 63aa7b9..3b416bb 100644 --- a/src/pquery.c +++ b/src/pquery.c @@ -119,7 +119,7 @@ static int lex(struct yaz_pqf_parser *li) return li->query_look = query_token(li); } -static int escape_string(char *out_buf, const char *in, int len) +int escape_string(char *out_buf, const char *in, int len) { char *out = out_buf; @@ -307,11 +307,11 @@ static Z_AttributesPlusTerm *rpn_term_attributes(struct yaz_pqf_parser *li, ODR Z_Term *term; zapt = (Z_AttributesPlusTerm *)odr_malloc(o, sizeof(*zapt)); - term_octet = (Odr_oct *)odr_malloc(o, sizeof(*term_octet)); term = (Z_Term *)odr_malloc(o, sizeof(*term)); zapt->term = term; zapt->attributes = attributes; + term_octet = (Odr_oct *)odr_malloc(o, sizeof(*term_octet)); term_octet->buf = (unsigned char *)odr_malloc(o, 1 + li->lex_len); term_octet->size = term_octet->len = escape_string((char *) (term_octet->buf), li->lex_buf, li->lex_len);