]> code.citadel.org Git - citadel.git/blobdiff - citadel/messages.c
fix all the <time.h> vs. <sys/time.h> issues, hopefully
[citadel.git] / citadel / messages.c
index a89e55aba5c1d05d78d933a125cc9611f79595e5..6167a8378dd96d97cd8963d372d1ed5a8e621cf8 100644 (file)
 #include <limits.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
-#include <sys/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 <stdarg.h>
 #include "citadel.h"
 #include "messages.h"
@@ -1104,6 +1115,14 @@ void readmsgs(
                }
        }
 
+       if (num_msgs == 0) {
+               printf("*** There are no ");
+               if (c == 1) printf("new ");
+               if (c == 2) printf("old ");
+               printf("messages in this room.\n");
+               return;
+       }
+
        lines_printed = 0;
 
        /* this loop cycles through each message... */