]> code.citadel.org Git - citadel.git/blobdiff - citadel/support.c
- port to Cygwin (DLL support, etc.)
[citadel.git] / citadel / support.c
index 2ff3ba7fbc45b9e3342d51769f7a267d8549c572..3262890b2cabec271475df30acbd6b45a5c5b1e5 100644 (file)
@@ -1,10 +1,20 @@
-/* $Id$ */
+/*
+ * $Id$
+ *
+ * Server-side utility functions
+ *
+ */
+
+#ifdef DLL_EXPORT
+#define IN_LIBCIT
+#endif
+
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>
-#include <pthread.h>
 #include "citadel.h"
 #include "server.h"
 #include "support.h"
@@ -17,6 +27,7 @@ void strproc(char *string)
 {
        int a;
 
+       if (string == NULL) return;
        if (strlen(string)==0) return;
 
        /* Convert non-printable characters to blanks */
@@ -96,14 +107,14 @@ int pattern2(char *search, char *patn)
 void mesg_locate(char *targ, char *searchfor, int numdirs, char **dirs)
 {
        int a;
-       char buf[256];
+       char buf[SIZ];
        FILE *ls;
 
        for (a=0; a<numdirs; ++a) {
                sprintf(buf,"cd %s; exec ls",dirs[a]);
                ls = (FILE *) popen(buf,"r");
                if (ls != NULL) {
-                       while(fgets(buf,255,ls)!=NULL) {
+                       while(fgets(buf,sizeof buf,ls)!=NULL) {
                                while (isspace(buf[strlen(buf)-1]))
                                        buf[strlen(buf)-1] = 0;
                                if (!strcasecmp(buf,searchfor)) {