Bug fix: the change above introduced an error.
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 5 Jun 1996 09:26:19 +0000 (09:26 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 5 Jun 1996 09:26:19 +0000 (09:26 +0000)
CHANGELOG
grs.c

index b161206..e71da69 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,4 @@
-$Id: CHANGELOG,v 1.17 1996-06-05 08:59:22 adam Exp $
+$Id: CHANGELOG,v 1.18 1996-06-05 09:26:19 adam Exp $
 
 06/19/95 Release of ir-tcl-1.0b
 ------------------------------------------------------
@@ -83,7 +83,7 @@ $Id: CHANGELOG,v 1.17 1996-06-05 08:59:22 adam Exp $
 20/02/96 Identification of record syntaxes, etc. are handled by the YAZ
          oid utilities.
 
-29/05/96 Set function getGrs enhanced so that specific elements can be
+05/06/96 Set function getGrs enhanced so that specific elements can be
          extracted by (<tagType>,<tagVal>) - pairs.
 
 
diff --git a/grs.c b/grs.c
index fa8de69..afcaa4b 100644 (file)
--- a/grs.c
+++ b/grs.c
@@ -5,7 +5,10 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: grs.c,v $
- * Revision 1.6  1996-06-05 08:59:23  adam
+ * Revision 1.7  1996-06-05 09:26:20  adam
+ * Bug fix: the change above introduced an error.
+ *
+ * Revision 1.6  1996/06/05  08:59:23  adam
  * Changed syntax of element specs in GRS-1 retrieval.
  *
  * Revision 1.5  1996/05/29  20:28:08  adam
@@ -184,7 +187,7 @@ static int ir_tcl_get_grs_r (Tcl_Interp *interp, IrTcl_GRS_Record *grs_record,
             else
             {
                 if (*cp0 == '(')
-                    cp++;
+                    cp0++;
                 if (atoi(cp0) == e->tagType) 
                 {
                     if (e->tagWhich == Z_StringOrNumeric_numeric)
@@ -194,7 +197,11 @@ static int ir_tcl_get_grs_r (Tcl_Interp *interp, IrTcl_GRS_Record *grs_record,
                     }
                     else
                     {
-                        if (!strcmp (cp1+1, e->tagVal.str))
+                        int len = strlen(cp1+1);
+                        if (cp1[len] == ')')
+                            len--;
+                        if (len && strlen(e->tagVal.str) == len &&
+                            !memcmp (cp1+1, e->tagVal.str, len))
                             yes = 1;
                     }
                 }