bug-gnats
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Duplicate 'index' entries


From: Robert Lupton the Good
Subject: Re: Duplicate 'index' entries
Date: Mon, 28 Jan 2002 16:24:26 -0500

I fixed (or at least worked around) a bug that caused this problem a
few months ago, but didn't fix the problem properly.

The gnats 3 code is terribly lazy about checking return codes, so if
it has trouble parsing a PR it simply continues, but indexes the
values of the _previous_ correct one.  It didn't seem worth fixing
when gnats 4 was just around the corner.

I didn't generate a patch, and I see that my cvs copy is relative
to an ancient cygnus root, but here's a copy of all my local changes,
as revealed via *.c~ files [urhhggg].  Not all are relevant to this
problem (some fix SEGVs while processing pending PRs), but...



                                        R



*** cmds.c      Mon Jan 29 16:38:57 2001
--- cmds.c~     Tue Sep 28 11:49:51 1999
***************
*** 798,808 ****
        h = raw_header_value (X_GNATS_NOTIFY);
        if (h)
        {
!         char *h2 = strchr (h, '\n');
!         if (h2 != NULL)
!           {
!              h2[0] = '\0';
!           }
          addrs[naddrs++] = strdup (h);
        }
        addrs[naddrs] = NULL;
--- 798,804 ----
        h = raw_header_value (X_GNATS_NOTIFY);
        if (h)
        {
!         char *h2 = strchr (h, '\n'); h2[0] = '\0';
          addrs[naddrs++] = strdup (h);
        }
        addrs[naddrs] = NULL;
*** file-pr.c   Tue Mar 13 09:55:02 2001
--- file-pr.c~  Fri Feb  2 15:43:25 2001
***************
*** 678,684 ****
         n = (responsible != NULL && responsible->key != NULL)
         ? responsible->alias : p;
  
!        i = strlen (n);
         /* add in +2 to make checking the second case not a hassle. */
         if ((i + notify_len + 2) >= notify_size)
         {
--- 678,684 ----
         n = (responsible != NULL && responsible->key != NULL)
         ? responsible->alias : p;
  
!        i = strlen (p);
         /* add in +2 to make checking the second case not a hassle. */
         if ((i + notify_len + 2) >= notify_size)
         {
*** gen-closed-date.c   Mon Nov  1 16:58:00 1999
--- gen-closed-date.c~  Tue Sep 28 11:49:52 1999
***************
*** 76,82 ****
  
       p = pr[AUDIT_TRAIL].value;
  
!      if (!p || strlen (p) == 0) {
            /* No Audit-Trail at all; initialize Closed-Date */
            xfree (pr[CLOSED_DATE].value);
            pr[CLOSED_DATE].value = strdup ("");
--- 76,82 ----
  
       p = pr[AUDIT_TRAIL].value;
  
!      if (strlen (p) == 0) {
            /* No Audit-Trail at all; initialize Closed-Date */
            xfree (pr[CLOSED_DATE].value);
            pr[CLOSED_DATE].value = strdup ("");
***************
*** 278,287 ****
  
          get_closed ();
  
!         printf("%s/%s Closed-Date: %s\n",
!              (pr[NUMBER].value ? pr[NUMBER].value : "?"),
!              (pr[CATEGORY].value ? pr[CATEGORY].value : "?"),
!                (pr[CLOSED_DATE].value ? pr[CLOSED_DATE].value : "?"));
  
          if (!test_mode) {
               /* Reset the file mtime after writing it out */
--- 278,285 ----
  
          get_closed ();
  
!         printf("%s/%s Closed-Date: %s\n", pr[NUMBER].value, 
pr[CATEGORY].value,
!                pr[CLOSED_DATE].value);
  
          if (!test_mode) {
               /* Reset the file mtime after writing it out */
***************
*** 474,481 ****
    for (c = clist ; c ; c = c->next)
      do_category (c->c->key);
  
!   if (outfile)
!     fclose (outfile);
    
    /* unlock the whole thing. */
    unlock_gnats ();
--- 472,478 ----
    for (c = clist ; c ; c = c->next)
      do_category (c->c->key);
  
!   fclose (outfile);
    
    /* unlock the whole thing. */
    unlock_gnats ();
*** headers.c   Wed Oct 17 13:53:45 2001
--- headers.c~  Tue Sep 28 11:49:54 1999
***************
*** 138,151 ****
          
          l = get_token (line, token);
          i = lookup_header (token);
- 
-         if (token[0] == PR_START_FIELD && token[1])
-           {
-             i = (int) field_name (token);
-             if (i >= 0)
-               break;                  /* a PR field */
-           }
-         
          if (i == -1)
            continue;
  
--- 138,143 ----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]