Find a file
Kyle Evans 0760a2e9a4 man: reset OPTIND before parsing args
From jilles: POSIX requires that a script set `OPTIND=1` before using
different sets of parameters with `getopts`, or the results will be
unspecified.

The specific problem observed here is that we would execute `man -f` or
`man -k` without cleaning up state from man_parse_args()' `getopts`
loop.  FreeBSD's /bin/sh seems to reset OPTIND to 1 after we hit the
second getopts loop, rendering the following shift harmless; other
/bin/sh implementations will leave it at what we came into the loop at
(e.g., bash as /bin/sh), shifting off any keywords that we had.

Input from:	jilles
Reviewed by:	allanjude, bapt, imp
Sponsored by:	Klara, Inc.

(cherry picked from commit f555b39e6b)
2021-10-03 00:14:43 -05:00
.cirrus-ci Cirrus-CI: retry pkg installation on failure 2021-06-10 08:54:52 -04:00
.github/workflows .github: Attempt to un-break Clang 9 action 2021-05-29 04:38:07 +01:00
bin sh: improve command completion 2021-09-25 10:34:38 +02:00
cddl dtrace.1: Document a couple of preprocessor-related options 2021-09-14 08:50:42 -04:00
contrib contrib/tzdata: correct DST in Jordan and Samoa 2021-09-29 12:44:34 +08:00
crypto openssh: remove login class restrictions leftovers 2021-09-16 20:34:13 -04:00
etc Register /usr/tests/usr.bin/diff3 2021-09-25 10:34:39 +02:00
gnu Bump shared library versions after ncurses bump in 13. 2021-02-04 17:51:45 -08:00
include time.h: reduce CLOCK_ namespace pollution, move to _clock_id.h 2021-09-12 09:56:16 -06:00
kerberos5 kerberos5: Silence compiler warnings 2021-03-17 09:53:08 +00:00
lib pidfile test: guarantee nul termination of the read pid string 2021-10-01 03:32:22 +03:00
libexec Enable rc.d/jail within jails 2021-08-29 09:37:13 +02:00
release EC2: Default to UEFI booting 2021-09-25 09:20:58 -07:00
rescue Fix building rescue/rescue when sanitizers are enabled 2021-08-05 09:59:51 +01:00
sbin Eliminate an unnecessary rerun request in fsck_ffs. 2021-09-29 22:52:04 -07:00
secure caroot: cumulative cert update 2021-09-04 02:39:07 -05:00
share Update a sysctl name to nbuffers_pcpu in hwpmc.4 and pmcstat.c 2021-09-25 10:34:38 +02:00
stand loader: dev_net.c should use __func__ with printf 2021-10-01 09:55:18 +03:00
sys ixgbe: whitespace cleanup pass 2021-10-02 18:32:19 -07:00
targets Fix bootstrapping to actually build lldb-tblgen for later use 2021-09-07 13:08:18 +01:00
tests tests/sys/sys: Raise WARNS 2021-10-01 10:06:41 -04:00
tools test/ptrace/scescx.c: fix printing of braces for syscalls without args 2021-09-19 14:18:12 +03:00
usr.bin man: reset OPTIND before parsing args 2021-10-03 00:14:43 -05:00
usr.sbin syslog.conf.5: Fix the message priority order 2021-09-28 09:21:51 -04:00
.arcconfig arcconfig: add callsign again 2020-11-23 04:39:29 +00:00
.arclint
.cirrus.yml Cirrus-CI: reduce VM memory to 8G 2021-09-02 15:14:45 -04:00
.clang-format clang-format: Avoid breaking after the opening paren of function definitions 2020-10-28 11:54:00 +00:00
.gitattributes Add a basic clang-format configuration file 2019-06-07 15:23:52 +00:00
.gitignore Revert "bc: Vendor import of Gavin Howard's bc version 3.2.6" 2021-02-05 20:53:34 +01:00
COPYRIGHT copyrights: Happy New Year 2021 2020-12-31 10:29:44 -05:00
LOCKS
MAINTAINERS Add a pointer to csprng@ for the CSPRNG driver. This is enforced anyway by 2020-09-01 08:02:12 +00:00
Makefile Makefile: Fix MAKEOBJDIRPREFIX command-line variable check for bmake 2021-09-07 13:06:46 +01:00
Makefile.inc1 Fix bootstrapping to actually build lldb-tblgen for later use 2021-09-07 13:08:18 +01:00
Makefile.libcompat Prefer MK_SSP=no to SSP_CFLAGS= 2021-08-11 13:56:28 -03:00
Makefile.sys.inc
ObsoleteFiles.inc pmc(3): remove Pentium-related man pages and references 2021-08-30 12:54:47 -03:00
README Mark the repository has been converted to Git 2020-12-23 12:27:27 +08:00
README.md Revert "bc: Vendor import of Gavin Howard's bc version 3.2.6" 2021-02-05 20:53:34 +01:00
RELNOTES RELNOTES: Add entry for just-MFC'ed HiFive Unmatched support 2021-09-07 13:15:18 +01:00
UPDATING UPDATING: Add a note about OpenSSL defaulting KTLS to off. 2021-08-23 18:00:17 -07:00

FreeBSD Source:

This is the top level of the FreeBSD source directory. This file was last revised on: FreeBSD

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), https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html, and https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html for more information, including setting make(1) variables.

Source Roadmap:

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		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* 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.

sys/<arch>/conf Kernel configuration files. GENERIC is the configuration
		used in release builds. NOTES contains documentation of
		all possible entries.

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:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html