]> code.citadel.org Git - citadel.git/commitdiff
* CtdlFetchMessage() - generate a "<no text>" message body if there's none
authorArt Cancro <ajc@citadel.org>
Mon, 1 Nov 1999 00:54:02 +0000 (00:54 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 1 Nov 1999 00:54:02 +0000 (00:54 +0000)
  on disk.  Too much stuff goes haywire if there's no M field.

citadel/ChangeLog
citadel/msgbase.c

index 4e5d60398b4594534ad9720c7dcc366d7a4d7f9c..7fb7f67337803617cbf8486b08dabb5a5651a3f0 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 1.407  1999/11/01 00:54:02  ajc
+* CtdlFetchMessage() - generate a "<no text>" message body if there's none
+  on disk.  Too much stuff goes haywire if there's no M field.
+
 Revision 1.406  1999/10/31 18:17:17  ajc
 * Fixed buffer overrun in cmd_rchg()
 * Call master_cleanup() when time_to_die==1 for proper shutdown
@@ -1401,4 +1405,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
-
index 61497033655a58da05ed832c6964fe47199403eb..dd814337d5aaf3fc86831d18a7575a03fa7932f4 100644 (file)
@@ -627,7 +627,6 @@ struct CtdlMessage *CtdlFetchMessage(long msgnum)
        CIT_UBYTE field_header;
        size_t field_length;
 
-
        dmsgtext = cdb_fetch(CDB_MSGMAIN, &msgnum, sizeof(long));
        if (dmsgtext == NULL) {
                return NULL;
@@ -671,6 +670,10 @@ struct CtdlMessage *CtdlFetchMessage(long msgnum)
 
        cdb_free(dmsgtext);
 
+       /* Always make sure there's something in the msg text field */
+       if (ret->cm_fields['M'] == NULL)
+               ret->cm_fields['M'] = strdoop("<no text>\n");
+
        /* Perform "before read" hooks (aborting if any return nonzero) */
        if (PerformMessageHooks(ret, EVT_BEFOREREAD) > 0) {
                CtdlFreeMessage(ret);