Renamed the attachment so that mailman won't delete it.
diff -u -r1.232 bogoconfig.c
--- bogoconfig.c        15 Oct 2005 20:52:51 -0000      1.232
+++ bogoconfig.c        5 Nov 2005 00:14:39 -0000
@@ -169,6 +169,23 @@
 static char *get_string(const char *name, const char *arg)
 {
     char *s = xstrdup(arg);
+
+    /* scan option to delete comment (after '#') and preceding whitespace */
+    char *t = s;
+    bool quote = false;
+    for (t = s; *t != '\0' ; t += 1)
+    {
+       char c = *t;
+       if (c == '"')
+           quote ^= true;
+       if (!quote && c == '#') {
+           *t-- = '\0';
+           while (isspace(*t))
+               *t-- = '\0';
+           break;
+       }
+    }
+
     if (DEBUG_CONFIG(2))
        fprintf(dbgout, "%s -> '%s'\n", name, s);
     return s;
diff -u -r1.90 bogolexer.c
--- bogolexer.c 17 Jun 2005 03:31:06 -0000      1.90
+++ bogolexer.c 5 Nov 2005 00:14:39 -0000
@@ -92,6 +92,23 @@
 static char *get_string(const char *name, const char *arg)
 {
     char *s = xstrdup(arg);
+
+    /* scan option to delete comment (after '#') and preceding whitespace */
+    char *t = s;
+    bool quote = false;
+    for (t = s; *t != '\0' ; t += 1)
+    {
+       char c = *t;
+       if (c == '"')
+           quote ^= true;
+       if (!quote && c == '#') {
+           *t-- = '\0';
+           while (isspace(*t))
+               *t-- = '\0';
+           break;
+       }
+    }
+
     if (DEBUG_CONFIG(2))
        fprintf(dbgout, "%s -> '%s'\n", name, s);
     return s;
diff -u -r1.13 convert_unicode.c
--- convert_unicode.c   26 Jun 2005 01:06:26 -0000      1.13
+++ convert_unicode.c   5 Nov 2005 00:14:39 -0000
@@ -33,7 +33,7 @@
 #define        SP      ' '
 
 #include <iconv.h>
-iconv_t cd;
+iconv_t cd = NULL;
 
 static void map_nonascii_characters(void)
 {
@@ -135,6 +135,8 @@
        from_charset = charset_default;
 
     cd = bf_iconv_open( to_charset, from_charset );
+    if (cd == (iconv_t) -1)
+       cd = NULL;
 
     for (idx = 0; idx < COUNTOF(charsets); idx += 1)
     {

Reply via email to