More uh. yep. Dynamic Board stuff.

From: Patrick J. Dughi (dughi@IMAXX.NET)
Date: 03/04/98


        Two things.

        One, if I haven't covered it already, in the board writing
procedure make sure that you have removed the extra \r\n line - else your
messages will add a return char to the end each time you reboot.

        Two.  The boards don't like tildes.  Not even a little.  So, you
might want to do the following:

to db.c add the following function
char *
fread_string2(FILE * fl, char *error)
{
  char buf[MAX_STRING_LENGTH], tmp[512], *rslt;
  register char *point;
  int done = 0, length = 0, templength = 0;

  *buf = '\0';

  do {
    if (!fgets(tmp, 512, fl)) {

      fprintf(stderr, "SYSERR: fread_string2: format error at or near %s\n",
              error);
      exit(1);
    }
    /* If there is a '~' at the front, end; else put an "\r\n" over the
                                                                '\n'. */
    if ((point=strchr(tmp, '~')) && point==tmp)  {
      *point = '\0';
      done = 1;
    } else {
      point = tmp + strlen(tmp) - 1;
      *(point++) = '\r';
      *(point++) = '\n';
      *point = '\0';
    }

    templength = strlen(tmp);
    if (length + templength >= MAX_STRING_LENGTH) {
      log("SYSERR: fread_string: string too large (db.c)");
      log(error);
      exit(1);
    } else {
      strcat(buf + length, tmp);
      length += templength;
    }
  } while (!done);

  /* allocate space for the new string and copy it */
  if (strlen(buf) > 0) {
    CREATE(rslt, char, length + 1);

    strcpy(rslt, buf);
  } else
    rslt = NULL;

  return rslt;
}

and, to db.h

char *fread_string2(FILE * fl, char *error);

And then in boards.c search for fread_string and replace it with
fread_string2

        Basically it changes it from stoping when it hits a tilde to
waiting till when it hits a tilde _AND_ its the first char.

        Yes, its an exact copy of fread_string with a one line change. It
was either that or make an argument for fread string, and I didn't feel
ike making all the changes. This was less effort :)

(first noticed the problem when people put their web addrs in boards:
                http://www.someisp.net/~person and the tilde and
everything after it would be chopped off...)

                                        PjD


     +------------------------------------------------------------+
     | 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