unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Use of strcasestr
@ 2010-04-12 13:58 Tomas Carnecky
  2010-04-12 15:53 ` Dirk Hohndel
  2010-04-12 20:18 ` Mikhail Gusarov
  0 siblings, 2 replies; 6+ messages in thread
From: Tomas Carnecky @ 2010-04-12 13:58 UTC (permalink / raw
  To: Dirk Hohndel; +Cc: notmuch

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Use of strcasestr
  2010-04-12 13:58 Use of strcasestr Tomas Carnecky
@ 2010-04-12 15:53 ` Dirk Hohndel
  2010-04-12 20:18 ` Mikhail Gusarov
  1 sibling, 0 replies; 6+ messages in thread
From: Dirk Hohndel @ 2010-04-12 15:53 UTC (permalink / raw
  To: Tomas Carnecky; +Cc: notmuch

On Mon, 12 Apr 2010 15:58:10 +0200, Tomas Carnecky <tom@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.Last@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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Use of strcasestr
  2010-04-12 13:58 Use of strcasestr Tomas Carnecky
  2010-04-12 15:53 ` Dirk Hohndel
@ 2010-04-12 20:18 ` Mikhail Gusarov
  2010-04-13  2:04   ` Tomas Carnecky
  1 sibling, 1 reply; 6+ messages in thread
From: Mikhail Gusarov @ 2010-04-12 20:18 UTC (permalink / raw
  To: Tomas Carnecky; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 550 bytes --]


Twas brillig at 15:58:10 12.04.2010 UTC+02 when tom@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/

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Use of strcasestr
  2010-04-12 20:18 ` Mikhail Gusarov
@ 2010-04-13  2:04   ` Tomas Carnecky
  2010-04-13  2:42     ` Aaron Ecay
  2010-04-13  4:09     ` Dirk Hohndel
  0 siblings, 2 replies; 6+ messages in thread
From: Tomas Carnecky @ 2010-04-13  2:04 UTC (permalink / raw
  To: Mikhail Gusarov; +Cc: notmuch

On 4/12/10 10:18 PM, Mikhail Gusarov wrote:
>
> Twas brillig at 15:58:10 12.04.2010 UTC+02 when tom@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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Use of strcasestr
  2010-04-13  2:04   ` Tomas Carnecky
@ 2010-04-13  2:42     ` Aaron Ecay
  2010-04-13  4:09     ` Dirk Hohndel
  1 sibling, 0 replies; 6+ messages in thread
From: Aaron Ecay @ 2010-04-13  2:42 UTC (permalink / raw
  To: Tomas Carnecky; +Cc: notmuch

--- 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@gmail.com

Aaron

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Use of strcasestr
  2010-04-13  2:04   ` Tomas Carnecky
  2010-04-13  2:42     ` Aaron Ecay
@ 2010-04-13  4:09     ` Dirk Hohndel
  1 sibling, 0 replies; 6+ messages in thread
From: Dirk Hohndel @ 2010-04-13  4:09 UTC (permalink / raw
  To: Tomas Carnecky, Mikhail Gusarov; +Cc: notmuch

On Tue, 13 Apr 2010 04:04:39 +0200, Tomas Carnecky <tom@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 tom@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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-04-13  4:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-12 13:58 Use of strcasestr Tomas Carnecky
2010-04-12 15:53 ` Dirk Hohndel
2010-04-12 20:18 ` Mikhail Gusarov
2010-04-13  2:04   ` Tomas Carnecky
2010-04-13  2:42     ` Aaron Ecay
2010-04-13  4:09     ` Dirk Hohndel

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).