Re: hedit bpl16

From: Nate Winters (wintersn@HOTMAIL.COM)
Date: 05/15/00


I am running bpl16 with OasisOLC 2.0 and have added the heditv2.patch by
Siv. First I want to thank Siv for this patch. Looking at the archives he's
received nothing but complaints about a patch he was kind enough to make
available to the public.
   I have the patch working, except is adds an extra line of text at the
end of every help entry after you edit an entry and then reload the help
files (by either reload xhelp or rebooting). For example, when I edit a new
or existing entry by adding a line to it and save, everything is fine, it
looks perfect. Until I reload xhelp or reboot. Then an extra line is there.
Each time I do this another line is added. In hedit.c to remove empty lines
it used strip_string. With OasisOLC 2.0 it is strip_cr. I have tried both,
and neither is working. This is the code:

void hedit_save_to_disk(void)
{
  int i;
  FILE *fp;
  struct help_index_element *help;

  sprintf(buf, "%s/%s.new", HLP_PREFIX, HELP_FILE);
  if (!(fp = fopen(buf, "w+"))) {
    mudlog("SYSERR: OLC: Cannot open help file!", BRF, LVL_BUILDER, TRUE);
    return;
  }
  for (i = 0; i <= top_of_helpt; i++) {
    help = (help_table + i);

#if defined(HEDIT_LIST)
    sprintf(buf1, "OLC: Saving help entry %d.", i);
    log(buf1);
#endif

    /*
     * Remove the '\r\n' sequences from description.
     */
    strcpy(buf1, help->entry ? help->entry : "Empty");
    strip_cr(buf1);

    /*
     * Forget making a buffer, lets just write the thing now.
     */
    fprintf(fp, "%s\n%s\n#%d\n", help->keywords ? help-
>keywords : "UNDEFINED", buf1, help->min_level);
  }

  /*
   * Write final line and close.
   */
  fprintf(fp, "$~\n");
  fclose(fp);
  sprintf(buf2, "%s/%s", HLP_PREFIX, HELP_FILE);
  /*
   * We're fubar'd if we crash between the two lines below.
   */
  remove(buf2);
  rename(buf, buf2);
}

   I have done all of the obvious checks on stupid mistakes. I did include
genolc.h and all the stuff that needed to be from OLC 1.6 to 2.0. I
compared everything to the aedit patch for bpl16 that I recently added, as
Siv mentioned he had modeled hedit off aedit. When I compile I get no
errors, just the following warning:

In file included from hedit.c:14:
oasis.h:340: warning: parameter names (without types) in function
declaration
oasis.h:340: warning: data definition has no type or storage class

oasis.h line 340:
ACMD(do_oasis);

I don't understand why the above line is in oasis.h. Could use some
enlightenment there. Not sure if the two problems are related or not. All
help is greatly appreciated. Thanks in advance.

Rumble


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



This archive was generated by hypermail 2b30 : 04/10/01 PDT