X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fseshigh.c;h=c68af21944b30042d54464fe5912909fde69f49b;hb=407a291011ba2743e175f3d2a84d4c6837406f7c;hp=46e62102c1786b364d31204d71938d1da93dfe78;hpb=c0858501c14e5b74a62656042dc6c8ad6a2a242c;p=yaz-moved-to-github.git diff --git a/src/seshigh.c b/src/seshigh.c index 46e6210..c68af21 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: seshigh.c,v 1.125 2007-08-21 13:20:51 adam Exp $ + * $Id: seshigh.c,v 1.126 2007-08-22 08:11:28 adam Exp $ */ /** * \file seshigh.c @@ -2377,7 +2377,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) assoc->init->implementation_name, odr_prepend(assoc->encode, "GFS", resp->implementationName)); - version = odr_strdup(assoc->encode, "$Revision: 1.125 $"); + version = odr_strdup(assoc->encode, "$Revision: 1.126 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; resp->implementationVersion = odr_prepend(assoc->encode, @@ -3051,7 +3051,9 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd) /* For YAZ 2.0 and earlier it was the backend handler that initialized entries (member display_term did not exist) YAZ 2.0 and later sets 'entries' and initialize all members - including 'display_term'. + including 'display_term'. If YAZ 2.0 or later sees that + entries was modified - we assume that it is an old handler and + that 'display_term' is _not_ set. */ if (bsrr->num_entries > 0) { @@ -3110,8 +3112,13 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd) odr_malloc(assoc->encode, sizeof(*t)); t->suggestedAttributes = 0; t->displayTerm = 0; - if (bsrr->entries[i].display_term) + if (save_entries == bsrr->entries && + bsrr->entries[i].display_term) { + /* the entries was _not_ set by the handler. So it's + safe to test for new member display_term. It is + NULL'ed by us. + */ t->displayTerm = odr_strdup(assoc->encode, bsrr->entries[i].display_term); }