Robert Clausecker 253f15c016 libc/amd64/strrchr.S: rewrite and fix scalar implementation
The original scalar implementation of strrchr() had incorrect
logic that failed if the character searched for was the NUL
character.  It was also possibly affected by the issue fixed
in 3d8ef251a for strchrnul().

Rewrite the function with logic that actually works.  We defer
checking for the character until after we have checked for NUL.
When we encounter the final NUL byte, we mask out the characters
beyond the tail before checking for a match.

This bug only affects users running on amd64 with ARCHLEVEL=scalar
(cf. simd(7)).  The default configuration is not affected.

The bug was unfortunately not caught by the unit test inherited
from NetBSD.  An extended unit test catching the issue is proposed
in D56037.

PR:		293915
Reported by:	safonov.paul@gmail.com
Tested by:	safonov.paul@gmail.com
Fixes:		2ed514a220
See also:	https://reviews.freebsd.org/D56037
MFC after:	1 week
2026-03-26 12:41:49 +01:00
2026-03-22 10:31:23 -04:00
2026-03-20 13:10:59 +08:00
2026-03-24 12:02:32 +01:00
2026-02-17 14:46:52 +00:00
2026-03-23 06:41:59 +00:00
2026-02-21 20:53:19 -05:00
2026-03-06 01:46:53 +02:00
2026-02-21 20:53:19 -05:00
2026-03-26 10:25:50 +01:00
2026-03-22 10:32:11 -04:00
2026-03-22 10:31:23 -04:00
2026-03-07 00:51:15 -07:00
2026-03-22 10:32:11 -04:00
2026-01-01 00:29:23 +00:00
2023-12-26 10:28:25 -07:00
2026-03-22 10:32:11 -04:00

FreeBSD Source:

This is the top level of the FreeBSD source directory.

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), FreeBSD handbook on building userland, and Handbook for kernels for more information, including setting make(1) variables.

For information on the CPU architectures and platforms supported by FreeBSD, see the FreeBSD website's Platforms page.

For official FreeBSD bootable images, see the release page.

Source Roadmap:

Directory Description
bin System/user commands.
cddl Various commands and libraries under the Common Development and Distribution License.
contrib Packages contributed by 3rd parties.
crypto Cryptography stuff (see crypto/README).
etc Template files for /etc.
gnu Commands and libraries under the GNU General Public License (GPL) or Lesser General Public License (LGPL). Please see gnu/COPYING and gnu/COPYING.LIB for more information.
include System include files.
kerberos5 Kerberos5 (Heimdal) package.
lib System libraries.
libexec System daemons.
release Release building Makefile & associated tools.
rescue Build system for statically linked /rescue utilities.
sbin System commands.
secure Cryptographic libraries and commands.
share Shared resources.
stand Boot loader sources.
sys Kernel sources (see sys/README.md).
targets Support for experimental DIRDEPS_BUILD
tests Regression tests which can be run by Kyua. See tests/README for additional information.
tools Utilities for regression testing and miscellaneous tasks.
usr.bin User commands.
usr.sbin System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see FreeBSD Handbook.

S
Description
Source code of KekenoBSD
https://kekenobsd.surge.sh
Readme 1.7 GiB
Languages
C 59.6%
C++ 27%
Roff 4.5%
Shell 2.8%
Assembly 1.7%
Other 3.8%