[PATCH #2] lexer.c [was: Error in compiling with russian support]

David Relson relson at osagesoftware.com
Wed May 25 00:12:46 CEST 2005


On Tue, 24 May 2005 18:26:13 +0500
Lev Butyrev wrote:

> > 
> > 
> > Hello Lev,
> > 
> > A function name in bogofilter's code got changed in one place, but not another.
> > 
> > You need this patch.
> > 
> > David
> > 
> > --- lexer.c.orig	24 Mar 2005 00:01:49 -0000	1.118
> > +++ lexer.c	23 May 2005 21:34:06 -0000
> > @@ -327,7 +327,7 @@
> >  
> >  /* EK -  decoding things like &#1084 and charset_table */
> >  #ifdef	CP866
> > -    count = htmlUNICODE_decode(buf, count);
> > +    count = decode_and_htmlUNICODE_to_cp866(buf, count);
> >  #else
> >  #ifndef ENABLE_ICONV
> >      for (i = 0; i < count; i++ )
> > _______________________________________________
> > Bogofilter mailing list
> > Bogofilter at bogofilter.org
> > http://www.bogofilter.org/mailman/listinfo/bogofilter
> 
> I apply patch. With configure option --enable-russian compilation 
> finished without errors. With configure option --enable-russian 
> --enable-iconv compilation error:
> gcc -DBOGOFILTER  -g -O2  -Wpointer-arith -ggdb -Wall -W 
> -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wbad-function-cast 
> -Wcast-qual -Wcast-align -Wwrite-strings -Waggregate-return 
> -Wmissing-declarations -Wmissing-format-attribute -Wnested-externs 
> -fno-common -Wchar-subscripts -Wcomment -Wimplicit -Wsequence-point 
> -Wreturn-type -Wno-system-headers -Wformat   -o bogofilter  bogofilter.o 
> main.o libbogofilter.a    strlcpy.o strlcat.o -ldb  libbf_gsl.a -lm
> libbogofilter.a(lexer.o)(.text+0x666): In function `yyinput':
> /tmp/bogofilter-0.94.12/src/lexer.c:330: undefined reference to 
> `decode_and_htmlUNICODE_to_cp866'
> collect2: ld returned 1 exit status
> 
> What i do wrong?

Hi Lev,

My fault, not yours!  With --enable-iconv it's not necessary for
lexer.c to call decode_and_htmlUNICODE_to_cp866().  The patch below
fixes the #ifdef statements.

David

Index: lexer.c
===================================================================
RCS file: /cvsroot/bogofilter/bogofilter/src/lexer.c,v
retrieving revision 1.119
diff -u -r1.119 lexer.c
--- lexer.c	23 May 2005 21:42:52 -0000	1.119
+++ lexer.c	24 May 2005 22:10:09 -0000
@@ -326,10 +326,10 @@
     }
 
 /* EK -  decoding things like &#1084 and charset_table */
+#ifndef ENABLE_ICONV
 #ifdef	CP866
     count = decode_and_htmlUNICODE_to_cp866(buf, count);
 #else
-#ifndef ENABLE_ICONV
     for (i = 0; i < count; i++ )
     {
 	byte ch = buf[i];



-- 
David Relson                   Osage Software Systems, Inc.
relson at osagesoftware.com       Ann Arbor, MI 48103
www.osagesoftware.com          tel:  734.821.8800



More information about the Bogofilter mailing list