X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=marc.c;h=9320d407522f59188eba2890a03b12fd4f999d29;hb=29101cf2d07dcd04cd5d6d4501b1a6107cc979ba;hp=6322dc609049803cadcc864b49358edf478e129a;hpb=ed6b88adb8132f4668c60113532d5c2da34523e7;p=ir-tcl-moved-to-github.git diff --git a/marc.c b/marc.c index 6322dc6..9320d40 100644 --- a/marc.c +++ b/marc.c @@ -5,7 +5,18 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: marc.c,v $ - * Revision 1.3 1995-05-29 08:44:26 adam + * Revision 1.5 1995-06-30 12:39:26 adam + * Bug fix: loadFile didn't set record type. + * The MARC routines are a little less strict in the interpretation. + * Script display.tcl replaces the old marc.tcl. + * New interactive script: shell.tcl. + * + * Revision 1.4 1995/06/22 13:15:09 adam + * Feature: SUTRS. Setting getSutrs implemented. + * Work on display formats. + * Preferred record syntax can be set by the user. + * + * Revision 1.3 1995/05/29 08:44:26 adam * Work on delete of objects. * * Revision 1.2 1995/05/26 11:44:11 adam @@ -32,6 +43,8 @@ static int atoi_n (const char *buf, int len) { int val = 0; + if (!isdigit (buf[len-1])) + return 0; while (--len >= 0) { if (isdigit (*buf)) @@ -103,6 +116,11 @@ int ir_tcl_get_marc (Tcl_Interp *interp, const char *buf, Tcl_AppendResult (interp, "Unknown MARC extract mode", NULL); return TCL_ERROR; } + if (!buf) + { + Tcl_AppendResult (interp, "Not a MARC record", NULL); + return TCL_ERROR; + } record_length = atoi_n (buf, 5); if (record_length < 25) {