]> code.citadel.org Git - citadel.git/blobdiff - citadel/msgbase.c
fix all the <time.h> vs. <sys/time.h> issues, hopefully
[citadel.git] / citadel / msgbase.c
index b4c8e0c088b52304007f6cac6f43fce07f0e7f6c..12afea81e35edda7671b9ca2ab8e9caf8624833a 100644 (file)
 #include <unistd.h>
 #include <stdio.h>
 #include <fcntl.h>
-#include <time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
 #include <ctype.h>
 #include <string.h>
 #include <syslog.h>
@@ -815,7 +826,7 @@ void fixed_output(char *name, char *filename, char *partnum, char *disp,
                char *ptr;
                char *wptr;
                size_t wlen;
-               CIT_UBYTE ch;
+               CIT_UBYTE ch = 0;
        
                if (!strcasecmp(cbtype, "multipart/alternative")) {
                        strcpy(ma->prefix, partnum);
@@ -840,9 +851,13 @@ void fixed_output(char *name, char *filename, char *partnum, char *disp,
                        wptr = content;
                        while (wlen--) {
                                ch = *wptr++;
+                               /**********
                                if (ch==10) cprintf("\r\n");
                                else cprintf("%c", ch);
+                                **********/
+                               cprintf("%c", ch);
                        }
+                       if (ch != '\n') cprintf("\n");
                }
                else if (!strcasecmp(cbtype, "text/html")) {
                        ptr = html_to_ascii(content, 80, 0);