... | ... |
@@ -1,3 +1,8 @@ |
1 |
+Fri Sep 25 00:31:29 CEST 2009 (acab) |
|
2 |
+------------------------------------ |
|
3 |
+ * fix several problems introduced by the win32 commits |
|
4 |
+ many thanks edwin and sherpya |
|
5 |
+ |
|
1 | 6 |
Thu Sep 24 19:43:50 CEST 2009 (acab) |
2 | 7 |
------------------------------------ |
3 | 8 |
* libclamav/others_common.c: Accept "/" as an absolute path |
... | ... |
@@ -103,8 +103,11 @@ static char const rcsid[] = "$Id: binhex.c,v 1.23 2007/02/12 20:46:08 njh Exp $" |
103 | 103 |
#include <stdio.h> |
104 | 104 |
#include <memory.h> |
105 | 105 |
#include <sys/stat.h> |
106 |
-#include "others.h" |
|
106 |
+#if defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) |
|
107 |
+#include <sys/mman.h> |
|
108 |
+#endif |
|
107 | 109 |
|
110 |
+#include "others.h" |
|
108 | 111 |
#include "mbox.h" |
109 | 112 |
#include "binhex.h" |
110 | 113 |
|
... | ... |
@@ -398,7 +398,6 @@ int cli_updatelimits(cli_ctx *, unsigned long); |
398 | 398 |
unsigned long cli_getsizelimit(cli_ctx *, unsigned long); |
399 | 399 |
int cli_matchregex(const char *str, const char *regex); |
400 | 400 |
void cli_qsort(void *basep, size_t nelems, size_t size, int (*comp)(const void *, const void *)); |
401 |
-int cli_is_abspath(const char *path); |
|
402 | 401 |
|
403 | 402 |
/* symlink behaviour */ |
404 | 403 |
#define CLI_FTW_FOLLOW_FILE_SYMLINK 0x01 |
... | ... |
@@ -910,13 +910,3 @@ void cli_qsort(void *basep, size_t nelems, size_t size, int (*comp)(const void * |
910 | 910 |
} |
911 | 911 |
} |
912 | 912 |
} |
913 |
- |
|
914 |
-int cli_is_abspath(const char *path) { |
|
915 |
-#ifdef _WIN32 |
|
916 |
- int len = strlen(path); |
|
917 |
- return (len > 2 && path[0] == '\\' && path[1] == '\\') || (len > 3 && path[1] == ':' && path[2] == '\\'); |
|
918 |
-#else |
|
919 |
- return *path == '/'; |
|
920 |
-#endif |
|
921 |
-} |
|
922 |
- |
... | ... |
@@ -41,7 +41,9 @@ static char const rcsid[] = "$Id: pdf.c,v 1.61 2007/02/12 20:46:09 njh Exp $"; |
41 | 41 |
#ifdef HAVE_UNISTD_H |
42 | 42 |
#include <unistd.h> |
43 | 43 |
#endif |
44 |
- |
|
44 |
+#if defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) |
|
45 |
+#include <sys/mman.h> |
|
46 |
+#endif |
|
45 | 47 |
#include <zlib.h> |
46 | 48 |
|
47 | 49 |
#include "clamav.h" |
... | ... |
@@ -316,3 +316,11 @@ int cfg_tcpsock(const struct optstruct *opts, struct sockaddr_in *tcpsock, in_ad |
316 | 316 |
return 0; |
317 | 317 |
} |
318 | 318 |
|
319 |
+int cli_is_abspath(const char *path) { |
|
320 |
+#ifdef _WIN32 |
|
321 |
+ int len = strlen(path); |
|
322 |
+ return (len > 2 && path[0] == '\\' && path[1] == '\\') || (len > 3 && path[1] == ':' && path[2] == '\\'); |
|
323 |
+#else |
|
324 |
+ return *path == '/'; |
|
325 |
+#endif |
|
326 |
+} |
... | ... |
@@ -54,4 +54,6 @@ int daemonize(void); |
54 | 54 |
const char *get_version(void); |
55 | 55 |
int match_regex(const char *filename, const char *pattern); |
56 | 56 |
int cfg_tcpsock(const struct optstruct *opts, struct sockaddr_in *server, in_addr_t defaultbind); |
57 |
+int cli_is_abspath(const char *path); |
|
58 |
+ |
|
57 | 59 |
#endif |