bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where's mdate-sh?


From: Sam Roberts
Subject: Re: Where's mdate-sh?
Date: Fri, 13 Apr 2001 23:47:41 -0400
User-agent: Mutt/1.3.16i

Quoting Jeff Bailey <address@hidden>, who wrote:
> On Fri, Apr 13, 2001 at 10:44:46PM -0400, Sam Roberts wrote:
> > The doc directory makefile fails without it.
> 
> mdate-sh is part of automake.

Oops... thanks.

Yes, sorry. I'm going through trying to get a clean build, and I
just noticed that automake reported some kind of error creating
it as a symbolic link. Probably a problem with symbolic links
under QNX Nto. I found it and put it in the right place, which
is in the directory *above* mailutils?!?

-- OT --

Btw, that perl expression looks horrendous, but 
it's printed like that to make it look worse than it is.

It really looks like:

$lwsp           = "(?:(?:\\r\\n)?[ \\t])";
$specials       = '()<>@,;:\\\\".\\[\\]';
$controls       = '\\000-\\031';
$dtext          = "[^\\[\\]\\r\\\\]";
$domain_literal = "\\[($dtext|\\\\.)*\\]$lwsp*";
$quoted_string  = "\"(?:[^\\\"\\r\\\\]|\\\\.|$lwsp)*\"$lwsp*";
$atom           = "[^$specials $controls]+(?:$lwsp+|\\Z|(?=[\\[\"$specials]))";
$word           = "(?:$atom|$quoted_string)";
$localpart      = "$word(?:\\.$lwsp*$word)*";
$sub_domain     = "(?:$atom|$domain_literal)";
$domain         = "$sub_domain(?:\\.$lwsp*$sub_domain)*";
$addr_spec      = "address@hidden";
$phrase         = "$word*";
$route          = "(?:address@hidden(?:,address@hidden)*:$lwsp*)";
$route_addr     = "\\<$lwsp*$route?$addr_spec\\>$lwsp*";
$mailbox        = "(?:$addr_spec|$phrase$route_addr)";
$group          = "$phrase:$lwsp*(?:$mailbox(?:,\\s*$mailbox)*)?;\\s*";
$address        = "(?:$mailbox|$group)";

Which is immediatly recognizable as a pretty straight-forward
intepretation of the EBNF.

If I took my C code, and inlined the C code for every function call,
I'd get some horrendous unreadable thing thousands of lines long, too.

Or if you took the half a page of EBNF in the RFC and expanded
it all, you'd get something that looks as bad as that block of
perl code. It's more an obfuscated code example than an example
of how hard it is to parse addresses. (And a stress test for perl's
RE engine).

Cheers!
Sam

p.s. Are you using it? I think it will reject something which
is explicitly valid (RFC 822, section 2.7):

address@hidden,,address@hidden

The RE is:
  m/^$rfc822re(,$rfc822re)*$/

but I think it should be:

  m/^($rfc822re)?(,($rfc822re)?)*$/

I just checked my own code, and it dies on:

 ,,address@hidden,,,,

RFC 822 is ambiguous about this, but looking at the
draft update, it says that that's valid (but obsolete - meaning
should be understood but not generated).

One more for my to-do list, I'm glad I took a look!

-- 
Sam Roberts <address@hidden> (Vivez sans temps mort!)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]