strrstr
Reuben Thomas
rrt@sc3d.org
Thu May 1 00:37:00 GMT 2008
On Wed, 30 Apr 2008, Roland McGrath wrote:
> What makes you say that strrstr is widely-used and widely-implemented?
> It's not in gnulib, for example, indicating it's not used widely among GNU
> programs. It's not provided by libc on BSD or Solaris, for example,
> indicating that it's not implemented widely on Unix-like systems.
It's not implemented on many operating systems, it seems (HP-UX being a
notable exception). It is however implemented in many programs. Google Code
Search/Google returns about 7,000/3,410 hits for "strrstr" (compared to
465,000/845,000 for "strstr"), in a wide range of programs, many well known,
like bash, apache, mysql, tin, gecko, glib,...It's usually in a suggestive
place in the source tree, like "stdlib" or "lib", suggesting that its
authors see it as a basic function. (The fact that glib contains it means
that gnulib need not support it as far as GNOME programs, or anything else
that uses glib, are concerned.)
It fills an obvious gap in the API (strchr, strrchr; strstr, strrstr), and
has the same semantics and name pretty much everywhere, so there's no
contention to resolve in what it should be called or do.
--
http://rrt.sc3d.org/ | romantic, n. one who puts ideas before people
More information about the Libc-alpha
mailing list