[Top][All Lists]

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

Re: memmem issues

From: Simon Josefsson
Subject: Re: memmem issues
Date: Thu, 20 Dec 2007 11:28:44 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

Eric Blake <address@hidden> writes:

> Several issues with memmem:
> - It uses memcmp without depending on the memcmp module, making it needlessly 
> fail on some older platforms.  But memcmp is currently licensed LGPL; is it 
> okay with everyone that this patch relicenses it as LGPLv2+?  (Or are such 
> platforms so obsolete that we can delete the memcmp module?)

I haven't run into any such problems, and we've built gnutls (which was
the original reason for memmem, IIRC) on a couple of embedded platforms
with otherwise strange environments.

> - test-memmem.c was flat-out broken (calling memmem with 3 instead of 4 
> arguments).  The reason it was never compiled was the lack of a memmem-tests 
> module.

The test was written for an earlier version of memmem() that were used
in gnutls.  When memmem was moved into gnulib, we aligned it with glibc
and used 4 arguments.

> - There are platform-specific bugs in existing memmem implementations.  
> Cygwin, 
> for example, returns NULL instead of haystack for memmem(haystack,len,"",0).  
> How best do I document platform bugs in non-standardized functions?


> Here's a patch for these issues; it breaks sync with glibc (and hence loses 
> the 
> K&R declaration).  Tested on cygwin (where memmem is broken) and mingw (where 
> memmem is missing).  Okay to apply?

Fine by me.  I'll test it if you commit it.


reply via email to

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