bug-gnulib
[Top][All Lists]
Advanced

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

Re: c-strstr


From: Bruno Haible
Subject: Re: c-strstr
Date: Fri, 11 Jan 2008 03:44:36 +0100
User-agent: KMail/1.5.4

Eric Blake wrote:
> is there any reason to have the c_strstr
> module?  Its implementation looks like it is identical to the POSIX
> requirements for strstr (POSIX states that strstr always operates on byte
> sequences, whether or not they form valid character strings for the
> current locale).  Your comments about when it is safe to use c_strstr
> rather than mbsstr, even in the presence of multibyte sequence locales, is
> useful, but as far as I could see, those comments apply equally to strstr.

The point of c-strstr is
  1) completeness of the c-str* functions API,
  2) I cannot recommend the use of the functions strstr, strcasecmp etc.
     to anyone: these functions don't work in multibyte locales. They
     are internationalized for ISO-8859-1 locales and therefore give a
     false sense of internationalization.

I'm adding doc about this:
  
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=4a3dfbf40eba25a6d355db2ae5ac721f862a0557

But I agree with you: The _implementation_ of c-strstr could make use
of the strstr() function because POSIX guarantees that the latter operates on
byte sequences.

Bruno





reply via email to

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