X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=retrieval%2Fd1_read.c;h=a4305657383bed57fe69ecba611b717522999df7;hp=e4b8d2356a79992656108bf132c730cd4e3d9a65;hb=e9728b65671cd921aeefddf5474689b0dbaf2010;hpb=bc33b8b53697bcc10a02f7e7456fd75b2c3473ef diff --git a/retrieval/d1_read.c b/retrieval/d1_read.c index e4b8d23..a430565 100644 --- a/retrieval/d1_read.c +++ b/retrieval/d1_read.c @@ -4,7 +4,14 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: d1_read.c,v $ - * Revision 1.11 1996-07-06 19:58:35 quinn + * Revision 1.13 1996-10-29 13:35:38 adam + * Implemented data1_set_tabpath and data1_get_tabpath. + * + * Revision 1.12 1996/10/11 10:35:38 adam + * Fixed a bug that caused data1_read_node to core dump when no abstract + * syntax was defined in a "sgml"-record. + * + * Revision 1.11 1996/07/06 19:58:35 quinn * System headerfiles gathered in yconfig * * Revision 1.10 1996/01/19 15:41:47 quinn @@ -93,8 +100,24 @@ char *data1_tabpath = 0; /* global path for tables */ -void data1_set_tabpath(char *p) -{ data1_tabpath = p; } +void data1_set_tabpath(const char *p) +{ + if (data1_tabpath) + { + xfree (data1_tabpath); + data1_tabpath = NULL; + } + if (p) + { + data1_tabpath = xmalloc (strlen(p)+1); + strcpy (data1_tabpath, p); + } +} + +const char *data1_get_tabpath (void) +{ + return data1_tabpath; +} #if 0 static data1_node *freelist = 0; @@ -391,6 +414,8 @@ data1_node *data1_read_node(char **buf, data1_node *parent, int *line, data1_node *partag = get_parent_tag(parent); #endif + if (!parent) /* abort if abstract syntax is undefined */ + return 0; /* Determine length and remove newlines/extra blanks */ while (**buf && **buf != '<') {