Re: bug in testing of message id's

Patrik Rådman <[email protected]>
Newsgroups gmane.network.sn
Message-ID <[email protected]>
Chris Niekel <[email protected]> wrote:
> Hi,
> 
> Ocassionally, I get a message that some messageid's are illegal, and
> that it has been replaced. I've been searching for the cause, and am
> looking at some strange code in int addr_domain(char* buf) (addr.c)
> 
> The behaviour:
>     [email protected] is good,
>     [email protected] is bad
>     [email protected] is good.
> 
> The code treats the '-' about the same as a '.', and thus doesn't allow
> multiple dashes after another. For the dot ('.') that makes sense, but
> for the '-', it's not right.
> 
> If I change the order of the '.' and the '-' in the case statement, my
> test-cases behave as expected.

Good catch. I've applied a shorter patch which should fix this, see below.

(As you may notice from the patch format, I'm trying out Subversion. :) )


Index: addr.c
===================================================================
--- addr.c      (revision 17)
+++ addr.c      (working copy)
@@ -45,7 +45,7 @@
             if (lb)
                return 0; /* else fall through */
          C('.')
-            if (p == buf || *p == p[-1] || !p[1])
+            if (p == buf || p[-1] == '.' || !p[1])
                 return 0;
              else
                 continue; /* Bugfix: no fall through */


-- 
  Patrik Rådman  ·  patrik at iki dot fi  ·  http://www.iki.fi/patrik/
                "I know this because Tyler knows this."
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.