X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fpquery.c;h=e2f28b40eb46e1a6107b52a6ec6f8a9d41a8e906;hb=03dccce903176e61f889b1558834aa5a09f9f8c0;hp=a023d96517c2cef91dd14314146b096fac5aff80;hpb=73662ac185d4f1151c0b99cde88aecd4c26fc097;p=yaz-moved-to-github.git diff --git a/src/pquery.c b/src/pquery.c index a023d96..e2f28b4 100644 --- a/src/pquery.c +++ b/src/pquery.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2011 Index Data + * Copyright (C) 1995-2012 Index Data * See the file LICENSE for details. */ /** @@ -84,7 +84,7 @@ static int query_token(struct yaz_pqf_parser *li) } while (**qptr && **qptr != sep_char) { - if (**qptr == '\\') + if (**qptr == '\\' && (*qptr)[1]) { ++(li->lex_len); ++(*qptr); @@ -258,7 +258,7 @@ Z_AttributeList *get_attributeList(ODR o, int num_attr, Odr_int *attr_list, return attributes; } elements = (Z_AttributeElement**) - odr_malloc (o, num_attr * sizeof(*elements)); + odr_malloc(o, num_attr * sizeof(*elements)); attr_tmp = (Odr_int *)odr_malloc(o, num_attr * 2 * sizeof(*attr_tmp)); memcpy(attr_tmp, attr_list, num_attr * 2 * sizeof(*attr_tmp)); @@ -888,7 +888,11 @@ Z_FacetList *yaz_pqf_parse_facet_list(ODR o, const char *qbuf) fl->elements = (Z_FacetField **) odr_malloc(o, num * sizeof(*fl->elements)); for (i = 0; i < num; i++) + { fl->elements[i] = parse_facet(o, darray[i]); + if (!fl->elements[i]) + return 0; + } return fl; } else