Use of strcasestr

2010-04-13 Thread Tomas Carnecky
On 4/12/10 10:18 PM, Mikhail Gusarov wrote:
>
> Twas brillig at 15:58:10 12.04.2010 UTC+02 when tom at dbservice.com did gyre 
> and gimble:
>
>   TC>  In 4fd9ea0 (guess From address from Received headers, 2010-04-06) you 
> introduced
>   TC>  strcasestr, which is not portable, see 82e47ec (notmuch reply: Use 
> strstr
>   TC>  instead of strcasestr for portability., 2010-02-04).
>
>   TC>  Is strcasestr really necessary there or can it be replaced with strstr?
>
> strcasecmp is POSIX.1-2001.

Indeed it is, but the code uses strcasestr and I couldn't find any 
indication which standard that function is part of.

Adding that function to compat/ probably is the way to go, but the whole 
compat mechanism doesn't work here. It's like if compat/Makefile.local 
was not included in the top-level makefile, notmuch_compat_srcs is empty 
there. Any ideas how to debug that?

tom



Use of strcasestr

2010-04-13 Thread Mikhail Gusarov

Twas brillig at 15:58:10 12.04.2010 UTC+02 when tom at dbservice.com did gyre 
and gimble:

 TC> In 4fd9ea0 (guess From address from Received headers, 2010-04-06) you 
introduced
 TC> strcasestr, which is not portable, see 82e47ec (notmuch reply: Use strstr
 TC> instead of strcasestr for portability., 2010-02-04).

 TC> Is strcasestr really necessary there or can it be replaced with strstr?

strcasecmp is POSIX.1-2001.

If you know any OS which does not have it, add a new file to compat/ subdir.

-- 
  http://fossarchy.blogspot.com/
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



Use of strcasestr

2010-04-12 Thread Aaron Ecay
--- 2010ko Apirilak 12an, Tomas Carnecky-ek idatzi zuen:

>
> Adding that function to compat/ probably is the way to go, but the whole
> compat mechanism doesn't work here. It's like if compat/Makefile.local was
> not included in the top-level makefile, notmuch_compat_srcs is empty
> there. Any ideas how to debug that?

If you are referring to the bug I think you are, I sent a patch to the list to
fix it yesterday.

id:1271029494-89014-2-git-send-email-aaronecay at gmail.com

Aaron


Use of strcasestr

2010-04-12 Thread Dirk Hohndel
On Tue, 13 Apr 2010 04:04:39 +0200, Tomas Carnecky  wrote:
> On 4/12/10 10:18 PM, Mikhail Gusarov wrote:
> >
> > Twas brillig at 15:58:10 12.04.2010 UTC+02 when tom at dbservice.com did 
> > gyre and gimble:
> >
> >   TC>  In 4fd9ea0 (guess From address from Received headers, 2010-04-06) 
> > you introduced
> >   TC>  strcasestr, which is not portable, see 82e47ec (notmuch reply: Use 
> > strstr
> >   TC>  instead of strcasestr for portability., 2010-02-04).
> >
> >   TC>  Is strcasestr really necessary there or can it be replaced with 
> > strstr?
> >
> > strcasecmp is POSIX.1-2001.
> 
> Indeed it is, but the code uses strcasestr and I couldn't find any 
> indication which standard that function is part of.
> 
> Adding that function to compat/ probably is the way to go, but the whole 
> compat mechanism doesn't work here. It's like if compat/Makefile.local 
> was not included in the top-level makefile, notmuch_compat_srcs is empty 
> there. Any ideas how to debug that?

While I don't have access to a system that doesn't provide strcasest
right now... I'll submit a patch in a moment that should add a
replacement function to compat.

Please check and make sure this works...

Thanks

/D

-- 
Dirk Hohndel
Intel Open Source Technology Center


Use of strcasestr

2010-04-12 Thread Tomas Carnecky
In 4fd9ea0 (guess From address from Received headers, 2010-04-06) you 
introduced strcasestr, which is not portable, see 82e47ec (notmuch 
reply: Use strstr instead of strcasestr for portability., 2010-02-04).

Is strcasestr really necessary there or can it be replaced with strstr?

tom



Use of strcasestr

2010-04-12 Thread Dirk Hohndel
On Mon, 12 Apr 2010 15:58:10 +0200, Tomas Carnecky  wrote:
> In 4fd9ea0 (guess From address from Received headers, 2010-04-06) you 
> introduced strcasestr, which is not portable, see 82e47ec (notmuch 
> reply: Use strstr instead of strcasestr for portability., 2010-02-04).
> 
> Is strcasestr really necessary there or can it be replaced with strstr?

Well, I'm trying to make sure that rAndOm case in email addresses
doesn't throw of the matching - it's quite common for people to write
email addresses as First.Last at Company.Com - the RFCs that I've seen
(can't double check, on a plane right now) seem to indicate that you
can't rely on the headers being lowercase - so even preprocessing the
configured email addresses might not be enough.
I guess we could selectively force some of the headers to be stored as
lower case - Received, X-Original-To, Envelope-To in my case - but that
seems wrong somehow.

Open to better ideas...

/D

-- 
Dirk Hohndel
Intel Open Source Technology Center


Use of strcasestr

2010-04-12 Thread Tomas Carnecky
In 4fd9ea0 (guess From address from Received headers, 2010-04-06) you 
introduced strcasestr, which is not portable, see 82e47ec (notmuch 
reply: Use strstr instead of strcasestr for portability., 2010-02-04).


Is strcasestr really necessary there or can it be replaced with strstr?

tom

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Use of strcasestr

2010-04-12 Thread Dirk Hohndel
On Mon, 12 Apr 2010 15:58:10 +0200, Tomas Carnecky t...@dbservice.com wrote:
 In 4fd9ea0 (guess From address from Received headers, 2010-04-06) you 
 introduced strcasestr, which is not portable, see 82e47ec (notmuch 
 reply: Use strstr instead of strcasestr for portability., 2010-02-04).
 
 Is strcasestr really necessary there or can it be replaced with strstr?

Well, I'm trying to make sure that rAndOm case in email addresses
doesn't throw of the matching - it's quite common for people to write
email addresses as first.l...@company.com - the RFCs that I've seen
(can't double check, on a plane right now) seem to indicate that you
can't rely on the headers being lowercase - so even preprocessing the
configured email addresses might not be enough.
I guess we could selectively force some of the headers to be stored as
lower case - Received, X-Original-To, Envelope-To in my case - but that
seems wrong somehow.

Open to better ideas...

/D

-- 
Dirk Hohndel
Intel Open Source Technology Center
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Use of strcasestr

2010-04-12 Thread Mikhail Gusarov

Twas brillig at 15:58:10 12.04.2010 UTC+02 when t...@dbservice.com did gyre and 
gimble:

 TC In 4fd9ea0 (guess From address from Received headers, 2010-04-06) you 
introduced
 TC strcasestr, which is not portable, see 82e47ec (notmuch reply: Use strstr
 TC instead of strcasestr for portability., 2010-02-04).

 TC Is strcasestr really necessary there or can it be replaced with strstr?

strcasecmp is POSIX.1-2001.

If you know any OS which does not have it, add a new file to compat/ subdir.

-- 
  http://fossarchy.blogspot.com/


pgp3d80eMLC7B.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Use of strcasestr

2010-04-12 Thread Tomas Carnecky

On 4/12/10 10:18 PM, Mikhail Gusarov wrote:


Twas brillig at 15:58:10 12.04.2010 UTC+02 when t...@dbservice.com did gyre and 
gimble:

  TC  In 4fd9ea0 (guess From address from Received headers, 2010-04-06) you 
introduced
  TC  strcasestr, which is not portable, see 82e47ec (notmuch reply: Use strstr
  TC  instead of strcasestr for portability., 2010-02-04).

  TC  Is strcasestr really necessary there or can it be replaced with strstr?

strcasecmp is POSIX.1-2001.


Indeed it is, but the code uses strcasestr and I couldn't find any 
indication which standard that function is part of.


Adding that function to compat/ probably is the way to go, but the whole 
compat mechanism doesn't work here. It's like if compat/Makefile.local 
was not included in the top-level makefile, notmuch_compat_srcs is empty 
there. Any ideas how to debug that?


tom

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Use of strcasestr

2010-04-12 Thread Aaron Ecay
--- 2010ko Apirilak 12an, Tomas Carnecky-ek idatzi zuen:


 Adding that function to compat/ probably is the way to go, but the whole
 compat mechanism doesn't work here. It's like if compat/Makefile.local was
 not included in the top-level makefile, notmuch_compat_srcs is empty
 there. Any ideas how to debug that?

If you are referring to the bug I think you are, I sent a patch to the list to
fix it yesterday.

id:1271029494-89014-2-git-send-email-aarone...@gmail.com

Aaron
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: Use of strcasestr

2010-04-12 Thread Dirk Hohndel
On Tue, 13 Apr 2010 04:04:39 +0200, Tomas Carnecky t...@dbservice.com wrote:
 On 4/12/10 10:18 PM, Mikhail Gusarov wrote:
 
  Twas brillig at 15:58:10 12.04.2010 UTC+02 when t...@dbservice.com did gyre 
  and gimble:
 
TC  In 4fd9ea0 (guess From address from Received headers, 2010-04-06) 
  you introduced
TC  strcasestr, which is not portable, see 82e47ec (notmuch reply: Use 
  strstr
TC  instead of strcasestr for portability., 2010-02-04).
 
TC  Is strcasestr really necessary there or can it be replaced with 
  strstr?
 
  strcasecmp is POSIX.1-2001.
 
 Indeed it is, but the code uses strcasestr and I couldn't find any 
 indication which standard that function is part of.
 
 Adding that function to compat/ probably is the way to go, but the whole 
 compat mechanism doesn't work here. It's like if compat/Makefile.local 
 was not included in the top-level makefile, notmuch_compat_srcs is empty 
 there. Any ideas how to debug that?

While I don't have access to a system that doesn't provide strcasest
right now... I'll submit a patch in a moment that should add a
replacement function to compat.

Please check and make sure this works...

Thanks

/D

-- 
Dirk Hohndel
Intel Open Source Technology Center
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch