Subscribe to list
Evgeny Kotsuba
evgen at shatura.laser.ru
Mon Sep 22 10:03:14 CEST 2003
Hi,
David Relson wrote:
>On Sat, 20 Sep 2003 20:23:54 +0400
>Evgeny Kotsuba <evgen at shatura.laser.ru> wrote:
>
>
>
>>Hi,
>>
>>What about developer from non-unix world ?
>>
>>SY,
>>Evegny Kotsuba
>>
>>
>>
>
>Hello Evegny,
>
>We're glad to have developers from outside the unix world. I was a
>happy user of OS/2 for many years. If memory serves me well, we've got
>an OS/2 user in Italy.
>
Well,
This is my two cents:
1) double definition of #define max in bogofilter\src\common.h
1.1) As far as I know many compilers have definition of max in STDLIB.H
2) Very incomprehensible error message "Can't open word " in
\src\wordlists.c -> void open_wordlists
"Can't open word (I:\home\default/.bogofilter), errno 23, The file or
directory s
pecified cannot be found."
May be it is worth to change it as
/src/wordlists.c
@@ -218,7 +231,7 @@ void open_wordlists(dbmode_t mode)
default:
if (query) /* If "-Q", failure is OK */
return;
- fprintf(stderr, "Can't open %s (%s), errno %d, %s\n",
+ fprintf(stderr, "Can't open %s db directory
(%s), errno %d, %s\n",
list->filename, list->filepath, err, strerror(err));
exit(EX_ERROR);
} /* switch */
3) Very incomprehensible filenames, paths etc for non-unix users, say lake
I:\home\default/.bogofilter
May be changed with patch like
diff -u -E -b -B -p M:\Evgen\Inet\Bogofilter\bogofilter\src\paths.c
G:\EVGEN\INET\SpamKill\BFilter\src\paths.c
--- M:\Evgen\Inet\Bogofilter\bogofilter\src\paths.c 2003-08-10
01:11:38.000000000 +0400
+++ G:\EVGEN\INET\SpamKill\BFilter\src\paths.c 2003-09-20
17:13:08.000000000 +0400
@@ -17,7 +17,20 @@ NAME:
#include "xmalloc.h"
#include "xstrdup.h"
-#define BOGODIR ".bogofilter"
+#ifdef __OS2__
+ #define BOGODIR "bogofilter"
+ #define SLASH '\\'
+ #define SLASH_STR "\\"
+#else
+ #define BOGODIR ".bogofilter"
+ #define SLASH '/'
+ #define SLASH_STR "/"
+#endif
+
char *build_progtype(const char *name, const char *db_type)
{
@@ -41,7 +54,7 @@ char *build_progtype(const char *name, c
int build_path(char* dest, size_t size, const char* dir, const char* file)
{
/* If absolute path ... */
- if (*file == '/') {
+ if (*file == SLASH) {
if (strlcpy(dest, file, size) >= size)
return -1;
else
@@ -50,7 +63,7 @@ int build_path(char* dest, size_t size,
if (strlcpy(dest, dir, size) >= size) return -1;
- if ('/' != dest[strlen(dest)-1]) {
+ if (SLASH != dest[strlen(dest)-1]) {
if (strlcat(dest, "/", size) >= size) return -1; /* RATS: ignore */
}
@@ -78,8 +91,8 @@ char *create_path_from_env(const char *v
buff = xmalloc(path_size);
strcpy(buff, env);
- if ('/' != buff[env_size-1]) {
- strcat(buff, "/");
+ if (SLASH != buff[env_size-1]) {
+ strcat(buff, SLASH_STR);
}
if (subdir != NULL) {
strcat(buff, subdir);
@@ -102,7 +115,11 @@ int check_directory(const char* path) /*
rc = stat(path, &sb);
if (rc < 0) {
if (ENOENT==errno) {
+#if defined(__IBMC__) || defined(__IBMCPP__)
+ if(mkdir(path)) {
+#else
if(mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR)) {
+#endif
fprintf(stderr, "Error creating directory \"%s\": %s\n",
path, strerror(errno));
return -1;
==================
You see macros __IBMC__ and __IBMCPP__ - this means that I don't use
gcc and use IBM's Visual Age C (3.08). In many aspects it is more close
to MS VC and (Open)Watcom than to gcc.
SY,
EK
More information about the bogofilter-dev
mailing list