History log of /freebsd-10-stable/lib/libc/string/strchr.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 251069 28-May-2013 emaste

Renumber clauses to reduce diffs to other versions

NetBSD, OpenBSD, and Android's Bionic number the clauses 1 through 3,
so follow suit to make comparison easier.


# 229571 05-Jan-2012 ed

Change index() and rindex() to a weak alias.

This allows people to still write statically linked applications that
call strchr() or strrchr() and have a local variable or function called
index.

Discussed with: bde@


# 229368 03-Jan-2012 ed

Merge index() and strchr() together.

As I looked through the C library, I noticed the FreeBSD MIPS port has a
hand-written version of index(). This is nice, if it weren't for the
fact that most applications call strchr() instead.

Also, on the other architectures index() and strchr() are identical,
meaning we have two identical pieces of code in the C library and
statically linked applications.

Solve this by naming the actual file strchr.[cS] and let it use
__strong_reference()/STRONG_ALIAS() to provide the index() routine. Do
the same for rindex()/strrchr().

This seems to make the C libraries and static binaries slightly smaller,
but this reduction in size seems negligible.


# 165903 08-Jan-2007 imp

Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.


# 123631 18-Dec-2003 jkh

Brucification: Don't initialize in declaration, make sure extra lines
follow declaration section.


# 123584 17-Dec-2003 jkh

Do comparison using appropriate casting first, as per SUSv3 (search for first
[last] character, not int).


# 102637 30-Aug-2002 robert

- Update the manual pages of index() and rindex() to show
<strings.h> as the associated header file.
The prototypes have been moved there from <string.h> because
POSIX.1-2001 said so.
- Conditionally include either <strings.h> or <string.h> based
on whether the [r]index() or str[r]chr() functions are
compiled, respectively.
- Style(9) tells us to
- put a space after the return keyword
- to check for a NUL character without using the ! operator.
- use NULL instead of (type *)NULL where the compiler knows
the type.
Apply these rules.
- Rather use ANSI-C function definitions than K&R ones.
- For index(3), correct second function argument's type; it was
declared to be a `const char' before and is now an `int'.


# 92889 21-Mar-2002 obrien

Remove 'register' keyword.


# 86170 07-Nov-2001 obrien

rcsid[]->__FBSDID


# 77117 24-May-2001 obrien

Make the rcsid and FreeBSD IDs more sane in the wcs* and wmem* files.
Do the same for the non-wcs*/wmem* files while I'm here.


# 1574 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1573,
which included commits to RCS files with non-trunk default branches.


# 1573 27-May-1994 rgrimes

BSD 4.4 Lite Lib Sources