-/* $Id: d1_marc.c,v 1.6 2003-12-17 12:03:54 adam Exp $
+/* $Id: d1_marc.c,v 1.6.2.1 2004-11-30 16:39:42 oleg Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
{
int i;
*len = n->u.data.len;
-
+
+ /* Fixme: don't delete leader/final whitespaces
for (i = 0; i<*len; i++)
if (!d1_isspace(n->u.data.data[i]))
break;
*len = *len - i;
if (*len > 0)
return n->u.data.data + i;
+ */
+ if (*len > 0)
+ return n->u.data.data;
}
if (n->which == DATA1N_tag)
n = n->child;
-/* $Id: marcread.c,v 1.24 2004-06-16 22:12:30 adam Exp $
+/* $Id: marcread.c,v 1.24.2.1 2004-11-30 16:39:42 oleg Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
{
int i;
*len = n->u.data.len;
-
+
+ /** Fixme: not delete leader/final whitespaces
+ ** in MARC field/subfield. It fixed in
+ ** data1/d1_marc.c too.
+
for (i = 0; i<*len; i++)
if (!d1_isspace(n->u.data.data[i]))
break;
*len = *len - i;
if (*len > 0)
return n->u.data.data + i;
+ **/
+ if (*len > 0)
+ return n->u.data.data;
}
if (n->which == DATA1N_tag)
n = n->child;
else
{
wrbuf_write(buf, found->data+p->interval.start,
- p->interval.end-p->interval.start);
+ p->interval.end-p->interval.start+1);
wrbuf_puts(buf, "");
}
if (strcmp(p->suffix, "_"))
inline_destroy_field(pif);
}
#if MARCOMP_DEBUG
- logf(LOG_LOG, "cat_inline_field(): got buffer {%s}", buf);
+ logf(LOG_LOG, "cat_inline_field(): got buffer {%s}", buf->buf);
#endif
}
else
{
wrbuf_write(buf, get_data(found, &len)+p->interval.start,
- p->interval.end-p->interval.start);
+ p->interval.end-p->interval.start+1);
wrbuf_puts(buf, "");
}
if (strcmp(p->suffix, "_"))
else
{
wrbuf_write(buf, get_data(field, &len)+pf->interval.start,
- pf->interval.end-pf->interval.start);
+ pf->interval.end-pf->interval.start+1);
wrbuf_puts(buf, "");
}
#if MARCOMP_DEBUG
- logf(LOG_LOG, "cat_field(): got buffer {%s}", buf);
+ logf(LOG_LOG, "cat_field(): got buffer {%s}", buf->buf);
#endif
return field->next;
}
cat_subfield(pf->list, buf, subfield);
#if MARCOMP_DEBUG
- logf(LOG_LOG, "cat_field(): got buffer {%s}", buf);
+ logf(LOG_LOG, "cat_field(): got buffer {%s}", buf->buf);
#endif
return field->next;