[DG-SCRIPTS] bug in dg_olc.c:trigedit_create_index()

From: Angus Mezick (amezick@EDGIL.COM)
Date: 11/05/98


 This code was added an entry to the index file EVERY time the trigger
was saved.  Here is the fix:

   sprintf(buf1, "%d.%s", znum, type);
   while (get_line(oldfile, buf))
      {
      if (*buf == '$')
      {
      fprintf(newfile, "%s\n$\n", (!found ? buf1 : ""));
      break;
      }
      else if (!found)
      {
      sscanf(buf, "%d", &num);
+     if(num==znum)
+        found=TRUE;
!     else if (num > znum)
         {
         found = TRUE;
         fprintf(newfile, "%s\n", buf1);
         }
      }
      fprintf(newfile, "%s\n", buf);
      }

You will need to use these commands to recover your index:
in lib/world/trg:

ls ?.trg>index
ls ??.trg>>index
ls ???.trg>>index
ls ????.trg>>index
echo \$>>index

--Angus


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST