X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=recctrl%2Frecgrs.c;h=9b6cc843b19d981ef2f1215365003022239fc8d2;hb=b385fad64ec1afb51fd0ec9ad76567282ab20bfe;hp=ae5a782b93e8b1200006ee25376e037bb64fad3e;hpb=26a5a4b96b90361859cf856d6c41852b03ca2f84;p=idzebra-moved-to-github.git diff --git a/recctrl/recgrs.c b/recctrl/recgrs.c index ae5a782..9b6cc84 100644 --- a/recctrl/recgrs.c +++ b/recctrl/recgrs.c @@ -1,5 +1,5 @@ -/* $Id: recgrs.c,v 1.72 2003-02-04 12:06:47 pop Exp $ - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 +/* $Id: recgrs.c,v 1.76 2003-04-24 19:34:19 adam Exp $ + Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003 Index Data Aps This file is part of the Zebra server. @@ -214,7 +214,7 @@ data1_termlist *xpath_termlist_by_tagpath(char *tagpath, data1_node *n) struct xpath_location_step *xp; #endif - char *pexpr = malloc(strlen(tagpath)+2); + char *pexpr = xmalloc(strlen(tagpath)+2); int ok = 0; sprintf (pexpr, "%s\n", tagpath); @@ -279,6 +279,8 @@ data1_termlist *xpath_termlist_by_tagpath(char *tagpath, data1_node *n) } xpe = xpe->next; } + + xfree(pexpr); if (ok) { logf(LOG_DEBUG,"Got it"); @@ -561,10 +563,10 @@ static void index_termlist (data1_node *par, data1_node *n, tlist->att->name, tlist->att->value, tlist->source); printf (" data=\""); - for (i = 0; ilength && i < 8; i++) + for (i = 0; ilength && i < 40; i++) fputc (wrd->string[i], stdout); fputc ('"', stdout); - if (wrd->length > 8) + if (wrd->length > 40) printf (" ..."); fputc ('\n', stdout); } @@ -968,14 +970,25 @@ static int grs_retrieve(void *clientData, struct recRetrieveCtrl *p) #if 0 data1_pr_tree (p->dh, node, stdout); #endif +#if YAZ_VERSIONL >= 0x010903L if (p->comp && p->comp->which == Z_RecordComp_complex && p->comp->u.complex->generic && - p->comp->u.complex->generic->schema) + p->comp->u.complex->generic->which == Z_Schema_oid && + p->comp->u.complex->generic->schema.oid) + { + oident *oe = oid_getentbyoid (p->comp->u.complex->generic->schema.oid); + if (oe) + requested_schema = oe->value; + } +#else + if (p->comp && p->comp->which == Z_RecordComp_complex && + p->comp->u.complex->generic && p->comp->u.complex->generic->schema) { oident *oe = oid_getentbyoid (p->comp->u.complex->generic->schema); if (oe) requested_schema = oe->value; } +#endif /* If schema has been specified, map if possible, then check that * we got the right one