Re: license of c-strcasestr

2011-03-30 Thread Bruno Haible
Eric Blake wrote: > libvirt just started using strcasestr() since it is LGPLv2+, but I would > rather it used c_strcasestr() to avoid problems with locales and > multi-byte characters. Any chance we can get the c-strcasestr module > relicensed to LGPLv2+ instead of its current LGPLv3+

license of c-strcasestr

2011-03-30 Thread Eric Blake
libvirt just started using strcasestr() since it is LGPLv2+, but I would rather it used c_strcasestr() to avoid problems with locales and multi-byte characters. Any chance we can get the c-strcasestr module relicensed to LGPLv2+ instead of its current LGPLv3+? -- Eric Blake ebl...@redhat.com

Re: [PATCH] memmem, strstr, strcasestr: fix bug with long periodic needle

2010-11-20 Thread Bruno Haible
Eric Blake wrote on 2010-10-05: > @@ -24,9 +63,9 @@ dnl Additionally, check that memmem is efficient and > handles empty needles. >  AC_DEFUN([gl_FUNC_MEMMEM], >  [ >    AC_REQUIRE([gl_FUNC_MEMMEM_SIMPLE]) > -  if test $ac_cv_have_decl_memmem = yes; then > +  if test $HAVE_MEMMEM = 1 && test $REPL

Re: [PATCH] memmem, strstr, strcasestr: fix bug with long periodic needle

2010-10-07 Thread Eric Blake
On 10/05/2010 05:42 PM, Bruno Haible wrote: Hi Eric, - #if CYGWIN_VERSION_DLL_MAJOR>= 1007 + #if CYGWIN_VERSION_DLL_MAJOR>= 1007&& CYGWIN_VERSION_DLL_MINOR> 7 I think this conditional expression will evaluate to false for Cygwin 1.8.0, 1.9.5, and so on, which is not intended. Indeed. And

Re: [PATCH] memmem, strstr, strcasestr: fix bug with long periodic needle

2010-10-05 Thread Bruno Haible
Hi Eric, > - #if CYGWIN_VERSION_DLL_MAJOR >= 1007 > + #if CYGWIN_VERSION_DLL_MAJOR >= 1007 && CYGWIN_VERSION_DLL_MINOR > 7 I think this conditional expression will evaluate to false for Cygwin 1.8.0, 1.9.5, and so on, which is not intended. The right expression should be #if (CYGWIN_VERSION_DL

[PATCH] memmem, strstr, strcasestr: fix bug with long periodic needle

2010-10-05 Thread Eric Blake
/memmem.texi (memmem): Document the bug. * doc/posix-functions/strstr.texi (strstr): Likewise. * doc/glibc-functions/strcasestr.texi (strcasestr): Likewise. Reported via http://sourceware.org/bugzilla/show_bug.cgi?id=12092 Signed-off-by: Eric Blake --- Rather a large patch for just a 2-line fix shared among

[PATCH] strstr, memmem, strcasestr: avoid leaked shell message

2010-08-30 Thread Eric Blake
.m4 |5 +++-- m4/strstr.m4 |5 +++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45bd20f..1091b41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,1 +1,1 @@ 2010-08-30 Eric Blake + strstr, memmem, strcasestr: avoid leaked shell message +

Re: strcasestr

2010-01-05 Thread Eric Blake
asecmp, not strcasestr). I'm pushing this. But meanwhile, you should consider whether you ever expect to handle multi-byte characters, in which case strcasecmp is worthless. -- Don't work too hard, make some time for fun as well! Eric Blake

strcasestr

2010-01-05 Thread Dilyan Palauzov
Hello, The documentation of gnulib states, that there is no gnulib module, that replaces strcasecmp (). At least this is my understanding for http://www.gnu.org/software/gnulib/manual/html_node/strcasecmp.html#strcasecmp . But at the same time the strcase module seems to implement strcase

Re: MacOS problem with "checking whether strcasestr works in linear time"

2008-06-10 Thread Eric Blake
failure if test takes too long, by using default abort caused by SIGALRM. All known platforms that lack alarm also lack - memmem, and the replacement memmem is known to not take too + strcasestr, and the replacement memmem is known to not take too long. */ signal (SIGALRM, SIG

Re: MacOS problem with "checking whether strcasestr works in linear time"

2008-06-10 Thread Ian Beckwith
On Mon, Jun 09, 2008 at 03:34:09PM -0700, Eric Blake wrote: > And explicitly resetting SIGALRM in the .m4 files avoided the hang. > I'm committing this. Great, that fixed it. Thanks! Ian. -- Ian Beckwith - [EMAIL PROTECTED] - http://erislabs.net/ianb/ GPG fingerprint: AF6C C0F1 1E74 424B BCD5

Re: MacOS problem with "checking whether strcasestr works in linear time"

2008-06-10 Thread Bruno Haible
Eric Blake wrote: > Go ahead and make the change if you feel better about it that way. Thanks. Yes, it feels safer this way. Applied: 2008-06-10 Bruno Haible <[EMAIL PROTECTED]> * tests/test-memmem.c (main): Reset SIGALRM to default handling before using alarm(). * tes

Re: MacOS problem with "checking whether strcasestr works in linear time"

2008-06-09 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 6/9/2008 7:03 PM: |> The corresponding tests/test-strstr.c and friends can continue to |> use alarm() in an environment with SIGALRM ignored, rather than |> also doing the signal reset, because a) we should already be usin

Re: MacOS problem with "checking whether strcasestr works in linear time"

2008-06-09 Thread Bruno Haible
Eric Blake wrote: > > Could it be that the process was started with SIGALRM inherited as ignored? Thanks for the fix. > The corresponding tests/test-strstr.c and friends can continue to > use alarm() in an environment with SIGALRM ignored, rather than > also doing the signal reset, because a) we

Re: MacOS problem with "checking whether strcasestr works in linear time"

2008-06-09 Thread Eric Blake
Ian Beckwith erislabs.net> writes: > I received a report that the gnulib "checking whether strcasestr works > in linear time" configure test on MacOS hangs for "3 to 4 hours" > before completing. Presumably this means the alarm() call in the test > doesn'

Re: MacOS problem with "checking whether strcasestr works in linear time"

2008-06-09 Thread Eric Blake
s free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -26,6 +26,7 @@ AC_DEFUN([gl_FUNC_STRCASESTR], AC_CACHE_CHECK([whether strcasestr works in linear time], [gl_cv_func_strcasestr_linear], [AC_RUN_IFELSE([AC_LANG_PR

Re: MacOS problem with "checking whether strcasestr works in linear time"

2008-06-09 Thread Paul Eggert
Eric Blake <[EMAIL PROTECTED]> writes: > Does adding a call > to "signal(SIGALRM,SIG_DFL);" prior to the alarm() in the test case help? Good point. And thanks; I think you've found the problem. But even if you haven't, that change sounds worthwhile even if it doesn't fix this particular bug.

Re: MacOS problem with "checking whether strcasestr works in linear time"

2008-06-09 Thread Eric Blake
Bruno Haible clisp.org> writes: > The config.log shows nothing unusual, other than > "checking whether strcasestr works in linear time ... result: yes" > > Two questions: > - Was the configuration running in some kind of virtual processor/machine > (Parallels,

Re: MacOS problem with "checking whether strcasestr works in linear time"

2008-06-09 Thread Bruno Haible
http://erislabs.net/ianb/tmp/config.log The config.log shows nothing unusual, other than "checking whether strcasestr works in linear time ... result: yes" Two questions: - Was the configuration running in some kind of virtual processor/machine (Parallels, QEMU, VirtualBox, VMware Fusion

Re: MacOS problem with "checking whether strcasestr works in linear time"

2008-06-08 Thread Ian Beckwith
On Mon, Jun 09, 2008 at 12:42:18AM +0200, Bruno Haible wrote: > On which MacOS X version was this? It configures fine and quickly for me > on MacOS X 10.3.9 and 10.5.2. Erm, don't know, I'll ask. In case you can map kernel versions to MacOS versions, config.log says: uname -v = Darwin Kernel Ver

Re: MacOS problem with "checking whether strcasestr works in linear time"

2008-06-08 Thread Bruno Haible
Ian Beckwith wrote: > I received a report that the gnulib "checking whether strcasestr works > in linear time" configure test on MacOS hangs for "3 to 4 hours" > before completing. Presumably this means the alarm() call in the test > doesn't work. Presumably

MacOS problem with "checking whether strcasestr works in linear time"

2008-06-08 Thread Ian Beckwith
Hi, I received a report that the gnulib "checking whether strcasestr works in linear time" configure test on MacOS hangs for "3 to 4 hours" before completing. Presumably this means the alarm() call in the test doesn't work. The version of gnuit with the problem is at:

Re: strcasestr [was: strstr speedup]

2008-01-19 Thread Bruno Haible
Eric Blake wrote: > Here's what I'm committing for strcasestr, including a strcasestr-simple > module, and the first attempt at a glibc function extensions chapter. Thanks for this! I've now extended the glibc function extensions chapter. > --- /dev/null > +++ b/do

c-strcasestr speedup

2008-01-16 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Following suit from other recent patches, here's a speedup for c-strcasestr, reducing the worst-case from a malloc and > 5n comparisons to an async-safe 3n comparisons. I'm pushing this. - -- Don't work too hard, make some ti

strcasestr [was: strstr speedup]

2008-01-14 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 1/11/2008 4:21 AM: | Eric Blake wrote: |> | should I go ahead and prepare a patch for strcasestr, c-strcasestr, and |> | memcasecmp to utilize str-two-way.h? | | Yes for strcasestr and c-strcasestr. Here'

Re: new module mbscasestr, remove module strcasestr

2007-03-02 Thread James Youngman
On 2/5/07, Bruno Haible <[EMAIL PROTECTED]> wrote: This introduces a new module mbscasestr. mbscasestr() is like glibc's strcasestr(), except it works on character strings (i.e. on multibyte strings). Thanks for adding this. Findutils 4.3.x now uses the mbscasestr and mbsstr modul

strcasestr: avoid quadratic time consumption

2007-02-11 Thread Bruno Haible
Like c_strstr, here is a patch for strcasestr that avoids quadratic asymptotic complexity. One could consider introducing new modules 'strstr-linear' and 'strcasestr-linear' which override the system's strstr() or strcasestr() functions if they have a quadratic worst-c

c-strcasestr: avoid quadratic time consumption

2007-02-11 Thread Bruno Haible
): New function. (c_strcasestr): Add some bookkeeping. Invoke knuth_morris_pratt when the bookkeeping indicates that it's worth it. * modules/c-strcasestr (Depends-on): Add stdbool, strnlen. * modules/c-strcasestr-tests: New file. * tests/test-c-strcasestr.

Re: new module mbscasestr, remove module strcasestr

2007-02-04 Thread Bruno Haible
software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -16,6 +16,5 @@ # Prerequisites of lib/strcasestr.c. AC_DEFUN([gl_PREREQ_STRCASESTR], [ - AC_REQUIRE([gl_FUNC_MBRTOWC]) : ]) --- modules/strcasestr 1 Feb 2007 00:29:52 - 1.5

new module mbscasestr, remove module strcasestr

2007-02-04 Thread Bruno Haible
This introduces a new module mbscasestr. mbscasestr() is like glibc's strcasestr(), except it works on character strings (i.e. on multibyte strings). The module strcasestr now only provides an non-internationalized equivalent to glibc's non-internationalized function!! 2007-02-04 Br

Re: strstr, strcase, strcasestr, and i18n

2007-02-04 Thread Bruno Haible
to find new names, yes. Yup. It appears that Microsoft did their homework regarding str* functions and multibyte strings, while the ISO C and POSIX communities didn't. I'll be adding the following functions to gnulib, attempting to fix the hole that ISO C and POSIX left. mbschr lik

Re: strstr, strcase, strcasestr, and i18n

2007-02-02 Thread Paul Eggert
Bruno Haible <[EMAIL PROTECTED]> writes: > - strstr: This function's behaviour is not clearly defined. POSIX says > that it compares a "string" with a "sequence of bytes". Which a priori > is nonsense, since the elements of strings are characters. No, elements of "character strings" are

strstr, strcase, strcasestr, and i18n

2007-02-01 Thread Bruno Haible
I wrote: > I think it's time for me to report a glibc bug on strstr and strcasestr, > then... Paul Eggert wrote: > But now that you mention it, why is there a c-strstr module, or a > fancy strstr replacement that looks at multibyte characters? The situation is indeed a

Re: [bug-gnulib] Question concerning c-ctype, c-strcase, c-strcasestr and c-strstr modules

2006-11-14 Thread Bruno Haible
ERS NO_TURKISH_USERS UTF_8_ALL_THE_WAY so that - when the first three are defined or the last one is defined, strstr uses the byte-for-byte implementation, - when additionally NO_TURKISH_USERS is defined, strcasestr uses the byte-for-byte implementation, - when UTF_8_ALL_THE_WAY

Re: [bug-gnulib] Re: [bug-gnulib] Re: Question concerning c-ctype, c-strcase, c-strcasestr and c-strstr modules

2006-11-14 Thread Bruno Haible
Yoann Vandoorselaere wrote: > "However, if we have a platform missing strcasestr, then using > c_strcasestr as the substitute implementation is probably okay, because > that platform would probably be broken in other areas, such as locale > support, ... Solaris 9 and Solar

Re: [bug-gnulib] Question concerning c-ctype, c-strcase, c-strcasestr and c-strstr modules

2006-11-14 Thread Yoann Vandoorselaere
On Tue, 2006-11-14 at 13:38 +0100, Bruno Haible wrote: > Yoann Vandoorselaere wrote: > > "However, if we have a platform missing strcasestr, then using > > c_strcasestr as the substitute implementation is probably okay, because > > that platform would probably be brok

Re: [bug-gnulib] Question concerning c-ctype, c-strcase, c-strcasestr and c-strstr modules

2006-11-14 Thread Yoann Vandoorselaere
> OK, embedded systems. What I can offer, as a compromise, is to introduce > flags like >NO_CHINESE_USERS >NO_JAPANESE_USERS >NO_KOREAN_USERS >NO_TURKISH_USERS >UTF_8_ALL_THE_WAY > so that > - when the first three are defined or the last one is defined

Re: [bug-gnulib] Re: Question concerning c-ctype, c-strcase, c-strcasestr and c-strstr modules

2006-11-14 Thread Bruno Haible
Yoann Vandoorselaere wrote: > Solaris 9 apparently lack the strcasestr() function. If the program needs strcasestr(), then it needs the 'strcasestr' module. It defines a replacement for strcasestr(). > Might we modify the > c-strcasestr module so that it provide a repla

Re: [bug-gnulib] Re: Question concerning c-ctype, c-strcase, c-strcasestr and c-strstr modules

2006-11-14 Thread Yoann Vandoorselaere
On Tue, 2006-11-14 at 11:40 +0100, Bruno Haible wrote: > Yoann Vandoorselaere wrote: > > Solaris 9 apparently lack the strcasestr() function. > > If the program needs strcasestr(), then it needs the 'strcasestr' module. > It defines a replacement for strcasestr()

Re: Question concerning c-ctype, c-strcase, c-strcasestr and c-strstr modules

2006-11-13 Thread Yoann Vandoorselaere
On Fri, 2006-09-15 at 05:35 -0600, Eric Blake wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > According to Yoann Vandoorselaere on 9/15/2006 5:29 AM: > > Hi, > > > > The c-ctype, c-strcase, c-strcasestr and c-strstr modules seem only to > > i

Re: [bug-gnulib] Question concerning c-ctype, c-strcase, c-strcasestr and c-strstr modules

2006-09-15 Thread Bruno Haible
Yoann Vandoorselaere wrote: > The c-ctype, c-strcase, c-strcasestr and c-strstr modules seem only to > implement their replacement functions using a "c_" prefix. > > However, there is no autoconf test implemented by these modules that > redefine the original function (

Re: Question concerning c-ctype, c-strcase, c-strcasestr and c-strstr modules

2006-09-15 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Yoann Vandoorselaere on 9/15/2006 5:40 AM: > > I recall platform missing strcasestr, although I can't remember which. > Anyway, what's the purpose of these modules if they are not used > anywhere ? The c_* modules

Re: Question concerning c-ctype, c-strcase, c-strcasestr and c-strstr modules

2006-09-15 Thread Yoann Vandoorselaere
On Fri, 2006-09-15 at 05:35 -0600, Eric Blake wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > According to Yoann Vandoorselaere on 9/15/2006 5:29 AM: > > Hi, > > > > The c-ctype, c-strcase, c-strcasestr and c-strstr modules seem only to > > i

Re: Question concerning c-ctype, c-strcase, c-strcasestr and c-strstr modules

2006-09-15 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Yoann Vandoorselaere on 9/15/2006 5:29 AM: > Hi, > > The c-ctype, c-strcase, c-strcasestr and c-strstr modules seem only to > implement their replacement functions using a "c_" prefix. > > However, there is

Question concerning c-ctype, c-strcase, c-strcasestr and c-strstr modules

2006-09-15 Thread Yoann Vandoorselaere
Hi, The c-ctype, c-strcase, c-strcasestr and c-strstr modules seem only to implement their replacement functions using a "c_" prefix. However, there is no autoconf test implemented by these modules that redefine the original function (in case it is missing) to point to their GnuLib r

new module 'c-strcasestr'

2005-10-10 Thread Bruno Haible
Likewise, here is a module for case-insensitive string search. Also needed by GNU gettext. Objections? Comments? = modules/c-strcasestr = Description: Case-insensitive searching in a string in C locale. Files: lib/c-strcasestr.h lib/c

Re: strcasestr compilation problem

2005-08-31 Thread Ben Pfaff
[EMAIL PROTECTED] (James Youngman) writes: > I haven't checked the code, but I suspect that a better choice would > be to include which must also #define NULL. That way you > end up with less other stuff being included without necessity and the > code stands a greater chance of working when comp

Re: strcasestr compilation problem

2005-08-31 Thread Bruno Haible
Yoann Vandoorselaere wrote: > The strcasestr module miss the inclusion of the stdio.h header, > resulting in missing declaration for the NULL identifier on some > systems. Thanks. I committed the appended fix. James Youngman writes: > I haven't checked the code, but I susp

Re: strcasestr compilation problem

2005-08-31 Thread Yoann Vandoorselaere
On Wed, 2005-08-31 at 08:59 +0100, James Youngman wrote: > On Wed, Aug 31, 2005 at 08:12:10AM +0200, Yoann Vandoorselaere wrote: > > > The strcasestr module miss the inclusion of the stdio.h header, > > resulting in missing declaration for the NULL identifier on some > >

Re: strcasestr compilation problem

2005-08-31 Thread James Youngman
On Wed, Aug 31, 2005 at 08:12:10AM +0200, Yoann Vandoorselaere wrote: > The strcasestr module miss the inclusion of the stdio.h header, > resulting in missing declaration for the NULL identifier on some > systems. I haven't checked the code, but I suspect that a better choi

strcasestr compilation problem

2005-08-30 Thread Yoann Vandoorselaere
Hi, The strcasestr module miss the inclusion of the stdio.h header, resulting in missing declaration for the NULL identifier on some systems. Regards, -- Yoann Vandoorselaere | Responsable R&D / CTO | PreludeIDS Technologies Tel: +33 (0)8 70 70 21 58 Fax: +33(0)4 78 42 2

Re: strcasestr module

2005-08-19 Thread Bruno Haible
I added this bugfix to the new strstr and strcasestr implementations. diff -c -3 -r1.1 strcasestr.c *** strcasestr.c17 Aug 2005 14:09:19 - 1.1 --- strcasestr.c19 Aug 2005 11:00:06 - *** *** 88,94 { if

Re: strcasestr module

2005-08-17 Thread Yoann Vandoorselaere
On Wed, 2005-08-17 at 20:37 +0200, Bruno Haible wrote: > Yoann Vandoorselaere wrote: > > About the strcasestr module, is there any reason why strcasestr is not > > redefined to rpl_strcasestr, since you plan that it will be a permanent > > strcasestr replacement ? > &

Re: strcasestr module

2005-08-17 Thread Bruno Haible
Yoann Vandoorselaere wrote: > About the strcasestr module, is there any reason why strcasestr is not > redefined to rpl_strcasestr, since you plan that it will be a permanent > strcasestr replacement ? The AC_DEFINE inside m4/strcasestr.m4 is meant to take care of this. Why doesn'

Re: strcasestr module

2005-08-17 Thread Yoann Vandoorselaere
On Wed, 2005-08-17 at 17:39 +0200, Bruno Haible wrote: > With the mbuiter module (unbounded iteration, similar to mbiter), it > was now easy to write strcasestr() in a way that works in multibyte locales. Hi Bruno, This look great, thanks for taking the time of making a multibyte strc

strcasestr module

2005-08-17 Thread Bruno Haible
With the mbuiter module (unbounded iteration, similar to mbiter), it was now easy to write strcasestr() in a way that works in multibyte locales. Bruno == modules/strcasestr Description: strcasestr() function: case-insensitive search for

Re: [PATCH]: strcasestr GnuLib module

2005-08-17 Thread Bruno Haible
> So I dug out an earlier 'mbchar' abstraction, and rewrite strcasecmp() > as follows. Now I split the iterator out into a separate module 'mbuiter', and simplified strcasecmp.c accordingly. Bruno ___ bug-gnulib mailing list bug-gnulib@gnu.org http:/

Re: [PATCH]: strcasestr GnuLib module

2005-08-16 Thread Bruno Haible
> > Thus, wouldn't it be wise to fix strcasecmp itself, and include it > > unconditionally in GnuLib ? > > Yes. Here's a patch to that effect. (Completely untested so far. Also > quite inefficient. One can do better with mbrtowc().) Well, that code was broken. And a similar code I wrote based on m

Re: [PATCH]: strcasestr GnuLib module

2005-08-15 Thread Bruno Haible
Yoann Vandoorselaere wrote: > As you can see from the code, this strcasestr implementation rely on > strcasecmp (I did not bothered to use the GLIBC implementation). > > Thus, wouldn't it be wise to fix strcasecmp itself, and include it > unconditionally in GnuLib ? Yes. He

Re: [bug-gnulib] [PATCH]: strcasestr GnuLib module

2005-08-15 Thread Yoann Vandoorselaere
On Mon, 2005-08-15 at 13:28 +0200, Bruno Haible wrote: > Hi, > > Yoann Vandoorselaere wrote: > > Attached is a patch that implement strcasestr() in GNUlib. > > Your implementation, like the one in glibc, does not work correctly in > multibyte locales. > > I'

Re: [bug-gnulib] [PATCH]: strcasestr GnuLib module

2005-08-15 Thread Bruno Haible
Hi, Yoann Vandoorselaere wrote: > Attached is a patch that implement strcasestr() in GNUlib. Your implementation, like the one in glibc, does not work correctly in multibyte locales. I'm not sure it's useful to add more functions to gnulib that do not work correctly in multibyte lo

[PATCH]: strcasestr GnuLib module

2005-08-13 Thread Yoann Vandoorselaere
Hi, Attached is a patch that implement strcasestr() in GNUlib. Regards, -- Yoann Vandoorselaere <[EMAIL PROTECTED]> diff -urNp gnulib.orig/lib/strcasestr.c gnulib/lib/strcasestr.c --- gnulib.orig/lib/strcasestr.c 1970-01-01 01:00:00.0 +0100 +++ gnulib/lib/strcasestr.c 2005-08-13