X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=rset%2Frset.c;h=f64ff45c8b210bddb63fade93f20419641bf02ec;hb=bbd69a699ce9596e5b2a83f9393d47b659a53cc6;hp=bec6da4b43c5c4d11a51541a0d5917321c3c4987;hpb=aeea139423b8eaf28a4de53b3d7b2ad1f22284e7;p=idzebra-moved-to-github.git diff --git a/rset/rset.c b/rset/rset.c index bec6da4..f64ff45 100644 --- a/rset/rset.c +++ b/rset/rset.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2011 Index Data + Copyright (C) Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -343,13 +343,11 @@ TERMID rset_term_create(const char *name, int length, const char *flags, zint hits_limit, const char *ref_id) { - TERMID t; - yaz_log (log_level, "term_create '%s' %d f=%s type=%d nmem=%p", - name, length, flags, type, nmem); - t= (TERMID) nmem_malloc(nmem, sizeof(*t)); + TERMID t = (TERMID) nmem_malloc(nmem, sizeof(*t)); + if (!name) - t->name = NULL; - else if (length == -1) + name = ""; + if (length == -1) t->name = nmem_strdup(nmem, name); else t->name = nmem_strdupn(nmem, name, length); @@ -430,6 +428,12 @@ void rset_visit(RSET rset, int level) rset_visit(rset->children[i], level+1); } +int rset_no_write(RSFD rfd, const void *buf) +{ + yaz_log(YLOG_FATAL, "%s set type is read-only", rfd->rset->control->desc); + return -1; +} + /* * Local variables: * c-basic-offset: 4