Home | History | Annotate | only in /src/bin/ksh
History log of /src/bin/ksh
RevisionDateAuthorComments
 1.39 05-Dec-2024  rillig ksh: suppress the 435 lint warnings about identifier list definitions

Leave the actual work of modernizing the function definitions to some
later day.
 1.38 05-Dec-2024  rillig ksh: clean up Makefile
 1.37 03-Jun-2023  lukem branches: 1.37.2;
adapt to ${CC_WNO_IMPLICIT_FALLTHROUGH}

Use ${CC_WNO_IMPLICIT_FALLTHROUGH} instead of
the older style more complex expressions.
 1.36 29-Sep-2019  mrg convert HAVE_GCC == 7 to HAVE_GCC >= 7.
 1.35 04-Feb-2019  mrg - use -Wno-error=implicit-fallthrough with GCC7.
 1.34 30-Jun-2017  kamil branches: 1.34.6;
ksh: Drop support for OSes without POSIX sigaction(2)
 1.33 16-Mar-2016  christos Put back awk, other scripts need it.
 1.32 16-Mar-2016  christos We don't need all this magic to build the signals lists. Do the work at
compile time.
 1.31 29-Jan-2015  joerg Make cast warnings for clang non-fatal.
 1.30 16-Oct-2011  joerg branches: 1.30.22;
Don't use non-literal format strings.
 1.29 14-Aug-2011  christos kill gcc-4.5 hack.
 1.28 22-Jun-2011  mrg apply some -Wno-error and/or -fno-strict-aliasing.


all of this should be looked at closer, but some of them are not
very trivial.
 1.27 26-May-2011  joerg Default to -Wno-sign-compare -Wno-pointer-sign for clang.
Push -Wno-array-bounds down to the cases that depend on it.
Selectively disable warnings for 3rd party software or non-trivial
issues to be reviewed later to get clang -Werror to build most of the
tree.
 1.26 14-Feb-2009  lukem Default to WARNS=4 (except for rcp & ksh)
 1.25 25-Oct-2008  apb branches: 1.25.4;
Pass SED=${TOOL_SED:Q} in the environment to scripts run during the build.
 1.24 20-Oct-2008  apb Pass AWK in environment to shell scripts run during the build.
 1.23 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.22 26-Oct-2003  lukem don't need -DHAVE_CONFIG_H here
 1.21 26-Oct-2003  lukem Use ${HOST_SH} instead of `sh'.

If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
 1.20 21-Oct-2003  lukem Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.
 1.19 19-Oct-2003  lukem rework to use the newer _MKMSGCREATE (et al) macros
 1.18 19-Oct-2003  lukem support MAKEVERBOSE
 1.17 01-Aug-2003  lukem Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
 1.16 03-Nov-2001  lukem default to WARNS=1 if not set
 1.15 15-May-2001  simonb Don't build ksh.1 if MKMAN == "no".
 1.14 26-Jun-2000  kleink $(CPP) -> $(CC) -E
 1.13 22-Jun-2000  soren CLEANFILES+= siglist.out emacs.out
 1.12 20-Oct-1999  hubertf branches: 1.12.6;
resolve conflicts
 1.11 22-Oct-1997  lukem branches: 1.11.4;
add dependancies to fix parallel compilation
 1.10 10-Oct-1997  christos branches: 1.10.2;
CFLAGS->CPPFLAGS
 1.9 20-Jul-1997  christos Remove WARNS=1 from all the subdirectory Makefiles, and add it to Makefile.inc
now that all /bin has been cleaned.
 1.8 20-Jul-1997  christos Fix compiler warnings
Add WARNS=1
 1.7 30-Jun-1997  phil Define USETBL to get tbl used in making man page. (Closed PR 3144.)
 1.6 09-May-1997  mycroft Use DPSRCS.
 1.5 09-May-1997  mycroft Eliminate bogus redefinitions of standard targets.
 1.4 16-Jan-1997  perry close pr-3111 -- use sh to invoke script instead of executing
 1.3 12-Jan-1997  tls RCS ID Police
 1.2 10-Oct-1996  jtc Removed missing.c beacuse NetBSD is not missing any of the functions
that it provides.
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.10.2.1 07-Nov-1997  lukem pull up rev 1.11 from trunk (approval by thorpej)
 1.11.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.6.2 26-Feb-2002  he Pull up revisions 1.14-1.16 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.12.6.1 03-Sep-2000  soren Pull up rev 1.13:
> date: 2000/06/22 05:42:22; author: soren; state: Exp; lines: +3 -1
> CLEANFILES+= siglist.out emacs.out
 1.25.4.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.30.22.1 14-May-2015  snj Pull up following revision(s) (requested by joerg in ticket #758):
bin/ksh/Makefile: revision 1.31
bin/ps/print.c: revision 1.123
external/bsd/iscsi/dist/src/lib/parameters.c: revision 1.4
external/bsd/iscsi/dist/src/lib/target.c: revision 1.9
external/gpl2/lvm2/dist/lib/commands/toolcontext.c: revision 1.8
external/gpl2/lvm2/dist/lib/format1/import-export.c: revision 1.2
gnu/dist/texinfo/makeinfo/xml.c: revision 1.2
sbin/bioctl/bioctl.c: revision 1.16
usr.sbin/isdn/isdnd/msghdl.c: revision 1.12
Drop pointer checks that are always true.
--
Comment out impossible code.
--
Remove tautologic check.
--
Skip vendor if the string is empty.
Use l_wmesg if the string is not empty. Don't bother checking l_name for
nullness.
--
Array can't be null.
--
Show display if it is not empty.
--
Make cast warnings for clang non-fatal.
 1.34.6.4 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.34.6.3 21-Apr-2020  martin Sync with HEAD
 1.34.6.2 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.34.6.1 10-Jun-2019  christos Sync with HEAD
 1.37.2.1 02-Aug-2025  perseant Sync with HEAD
 1.10 12-Dec-2007  lukem branches: 1.10.70;
use __RCSID()
 1.9 01-Apr-2006  christos branches: 1.9.10;
Coverity CID 1844: Add annotations for aresize.
 1.8 26-Mar-2006  christos correct coverity model.
 1.7 21-Mar-2006  christos Add coverity model annotations
 1.6 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.5 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.4 20-Oct-1999  hubertf resolve conflicts
 1.3 20-Jul-1997  christos branches: 1.3.6;
Fix compiler warnings
Add WARNS=1
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.10.1 09-Jan-2008  matt sync with HEAD
 1.10.70.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.10.70.1 21-Apr-2020  martin Sync with HEAD
 1.30 16-Sep-2021  christos support -Z
 1.29 03-Jun-2018  kamil branches: 1.29.2;
ksh: Remove symbol clash with libc

Rename local function twalk() to ksh_twak().
This is needed for installing interceptors in sanitizers.

Sponsored by <The NetBSD Foundation>
 1.28 08-May-2018  kamil Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.27 24-Jan-2018  kamil branches: 1.27.2;
ksh: Rename a local function tsearch to mytsearch

This removes a clash with well-known libc function tsearch(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by <The NetBSD Foundation>
 1.26 30-Jun-2017  kamil ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.25 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.24 22-Jun-2017  kamil Drop Ultrix support from ksh(1), a DEC UNIX for VAX
 1.23 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.22 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.21 22-Jun-2017  kamil Drop HP-UX support from ksh(1)

OK by <kre>
 1.20 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.19 22-Jun-2017  kamil Remove ancient cygwin support in ksh(1)

OK by <kre>
 1.18 16-Oct-2011  joerg Don't use non-literal format strings.
 1.17 31-Aug-2011  plunky NULL does not need a cast
 1.16 25-Apr-2009  lukem Fix most of the -Wsign-compare issues.
 1.15 24-Apr-2006  christos branches: 1.15.28;
Coverity CID 2993: Fix memory leak.
 1.14 20-Mar-2006  christos Coverity CID 1827: Plug memory leak.
 1.13 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.12 28-Oct-2004  dsl Add (unsigned char) casts to tolower/toupper and iscntrl calls.
Fixes PR 27593
 1.11 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.10 05-Jan-2004  jmmv Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
 1.9 25-Aug-2003  wiz From OpenBSD:
date: 2000/11/21 22:41:03; author: millert; state: Exp; lines: +2 -1
Add missing break that broke 'kill -s SIGNAME', bug report #1495
Fix from Hiroyuki.HORINOKUCHI@nrj.ericsson.se
 1.8 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.7 25-Sep-2002  provos change complete-list to first complete and then print a list,
also complete after '=' (dd), and ':' (ssh) and ` (backtick)
improvements from camield@openbsd.org. approved by perry and thorpej.
 1.6 11-Jun-2001  wiz Fix various misspellings of compatible/compatibility.
 1.5 20-Oct-1999  hubertf branches: 1.5.6;
resolve conflicts
 1.4 04-Nov-1998  christos branches: 1.4.4;
char->unsigned char casts for is*()
 1.3 19-Aug-1998  thorpej Add some braces to make egcs happy.
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.4 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.3 18-Dec-1996  jtc import pdksh 5.2.12
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.4.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.6.1 26-Feb-2002  he Pull up revision 1.6 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.15.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.27.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.27.2.1 21-May-2018  pgoyette Sync with HEAD
 1.29.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.29.2.1 21-Apr-2020  martin Sync with HEAD
 1.24 08-May-2018  kamil branches: 1.24.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.23 30-Jun-2017  kamil branches: 1.23.4;
ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.22 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.21 30-Jun-2017  kamil ksh: Drop support for systems with broken <sys/time.h> / <time.h>
 1.20 30-Jun-2017  kamil ksh: Drop support for systems with broken times(3)

This fallback code wouldn't work anyway.

times(3) is an obsolete interface by getrusage(2) and gettimeofday(2).
In future it will be swiched to more modern interfaces.

No functional change intended.
 1.19 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.18 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.17 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.16 11-Oct-2016  dholland PR 49595 William Ahern: The exit status of "unset NOTSET" should be 0, not 1.
(like 48312 but for ksh)
 1.15 18-Oct-2013  christos branches: 1.15.8;
Fixed unused warnings.
 1.14 31-Aug-2011  plunky branches: 1.14.2; 1.14.8;
NULL does not need a cast
 1.13 25-Apr-2009  lukem Fix most of the -Wsign-compare issues.
 1.12 01-Apr-2006  christos branches: 1.12.28;
Coverity CID 1836: Free Source after return from shell.
 1.11 18-Mar-2006  christos Coverity CID 877: Prevent NULL deref.
 1.10 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.9 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.8 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.7 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.6 20-Jan-2003  dsl Make 'times' be a proper posix special builtin.
(change agreed by christos and mailed to Michael Rendell)
 1.5 04-Jan-2003  wiz Spell output with two ts.
 1.4 04-Feb-2001  christos remove duplicate declarations, and fix nested externs.
 1.3 20-Oct-1999  hubertf branches: 1.3.6;
resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.3 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.11
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.6.1 26-Feb-2002  he Pull up revision 1.4 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.12.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.14.8.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.8.1 04-Nov-2016  pgoyette Sync with HEAD
 1.23.4.1 21-May-2018  pgoyette Sync with HEAD
 1.24.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.24.2.1 21-Apr-2020  martin Sync with HEAD
 1.11 14-Jun-2025  christos PR/59210: Collin Funk: Use more precise time test
 1.10 16-Sep-2021  christos branches: 1.10.4;
It is either teaching gcc about aaah or adding FALLTHROUGH.
 1.9 30-Jun-2017  kamil branches: 1.9.6;
ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.8 30-Jun-2017  kamil ksh: Drop support for OSes that don't map /dev/fd
 1.7 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.6 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.5 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.4 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.3 20-Oct-1999  hubertf resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.9.6.1 21-Apr-2020  martin Sync with HEAD
 1.10.4.1 02-Aug-2025  perseant Sync with HEAD
 1.3 07-Jul-2004  mycroft branches: 1.3.92;
Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.3.92.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.3.92.1 21-Apr-2020  martin Sync with HEAD
 1.16 30-Jun-2017  kamil branches: 1.16.6;
ksh: Drop support for systems with broken <sys/time.h> / <time.h>
 1.15 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.14 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.13 22-Jun-2017  kamil Drop HP-UX support from ksh(1)

OK by <kre>
 1.12 09-May-2015  christos CID 1225088: check return of getrlimit
 1.11 09-May-2015  christos CID 1225077: check getrlimit return
 1.10 09-Jun-2012  christos support RLIMIT_NTHR
 1.9 14-Sep-2008  sjg branches: 1.9.2;
Avoid sign extention problems leading to:
$ ulimit -dH
3145728
$ ulimit -d 3145728
ksh: ulimit: bad limit: Invalid argument
$
 1.8 16-Oct-2006  christos branches: 1.8.18;
use c99 initializers
 1.7 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.6 17-Apr-2004  christos understand rlimit sbsize
 1.5 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.4 20-Oct-1999  hubertf resolve conflicts
 1.3 03-Feb-1998  mycroft branches: 1.3.4;
Deal with GCC warnings.
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.3.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.18.1 24-Sep-2008  wrstuden Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.
 1.9.2.1 30-Oct-2012  yamt sync with head
 1.16.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.16.6.1 21-Apr-2020  martin Sync with HEAD
 1.7 30-Jun-2017  kamil branches: 1.7.6;
ksh: Drop support for systems without functional waitpid(2)
 1.6 30-Jun-2017  kamil ksh: Drop support for systems without POSIX signal routines
 1.5 30-Jun-2017  kamil ksh: Drop support for systems without implementation of EINTR

These systems weren't handled anyway.
 1.4 22-Jun-2017  kamil ksh: Drop fallback for BSD4.2 signal routines
 1.3 22-Jun-2017  kamil ksh: Drop support for systems without mmap(2)
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.7.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.7.6.1 21-Apr-2020  martin Sync with HEAD
 1.53 30-Jun-2017  kamil branches: 1.53.6;
ksh: Drop support for OSes without POSIX sigaction(2)
 1.52 30-Jun-2017  kamil ksh: Drop support for OSes that don't map /dev/fd
 1.51 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.50 30-Jun-2017  kamil ksh: Drop support for systems with broken <sys/time.h> / <time.h>
 1.49 30-Jun-2017  kamil ksh: Drop support for systems without POSIX lstat(2)
 1.48 30-Jun-2017  kamil ksh: Drop support for systems without POSIX <sys/wait.h>
 1.47 30-Jun-2017  kamil ksh: Drop support for systems with broken times(3)

This fallback code wouldn't work anyway.

times(3) is an obsolete interface by getrusage(2) and gettimeofday(2).
In future it will be swiched to more modern interfaces.

No functional change intended.
 1.46 30-Jun-2017  kamil ksh: Assume ANSI C prototypes
 1.45 30-Jun-2017  kamil ksh: Drop support for systems without functional waitpid(2)
 1.44 30-Jun-2017  kamil ksh: Drop support for systems without POSIX signal routines
 1.43 30-Jun-2017  kamil ksh: Drop support for systems without implementation of EINTR

These systems weren't handled anyway.
 1.42 30-Jun-2017  kamil ksh: Drop support for systems without handling shebang
 1.41 30-Jun-2017  kamil ksh: Drop support for OSes without POSIX types

Assume available: mode_t, off_t, pid_t, uid_t, rlim_t, sigset_t.
 1.40 30-Jun-2017  kamil ksh: Drop support for systems without <sys/wait.h>
 1.39 30-Jun-2017  kamil ksh: Drop support for systems without gid_t
 1.38 23-Jun-2017  kamil ksh: Drop support for systems without clock_t type
 1.37 23-Jun-2017  kamil ksh: Replace homegrown int_least32_t with the C99 version
 1.36 23-Jun-2017  kamil ksh: Drop support for systems that return void for closedir(2)
 1.35 23-Jun-2017  kamil ksh: Drop support for UNIX V7-style signal routines
 1.34 22-Jun-2017  kamil ksh: Drop fallback for BSD4.2 signal routines
 1.33 22-Jun-2017  kamil ksh: Remove fallback to BSD4.1 signal routines
 1.32 22-Jun-2017  kamil ksh: Drop support for systems without mmap(2)
 1.31 22-Jun-2017  kamil ksh: Drop support for systems without dup2(2)
 1.30 22-Jun-2017  kamil ksh: Drop support for ISC UNIX
 1.29 22-Jun-2017  kamil ksh: Drop support for systems without <limits.h>
 1.28 22-Jun-2017  kamil ksh: Drop support for systems without <fcntl.h>
 1.27 22-Jun-2017  kamil ksh: Drop support for systems without memmove(3) and stop using bcopy(3)
 1.26 22-Jun-2017  kamil ksh: Drop support for systems without memset(3)
 1.25 22-Jun-2017  kamil ksh: Drop usage of SVID header <memory.h>, it's legacy standard
 1.24 22-Jun-2017  kamil ksh: Drop support for systems without strcasecmp(3) and strncasecmp(3)
 1.23 22-Jun-2017  kamil ksh: Drop support for systems without strstr(3)
 1.22 22-Jun-2017  kamil ksh: Drop support for systems without <string.h>
 1.21 22-Jun-2017  kamil ksh: Drop support for systems without <stddef.h>

No functional change.
 1.20 22-Jun-2017  kamil ksh: Drop support for systems without <stdlib.h>

No functional change.
 1.19 22-Jun-2017  kamil ksh: Drop support for systems without <unistd.h>

This code wouldn't work for them anyway.

No functional change.
 1.18 22-Jun-2017  kamil ksh: Kill switch for CLOSEDIR_VOID (closedir(2) returns void)

No users in the code. No functional change.
 1.17 22-Jun-2017  kamil ksh: Assume that $CC handles const (ANSI C89)

No functional change.
 1.16 22-Jun-2017  kamil Drop support for $CC incapable to use void* / volatile* (pre ANSI C89)
 1.15 22-Jun-2017  kamil Drop Ultrix support from ksh(1), a DEC UNIX for VAX
 1.14 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.13 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.12 22-Jun-2017  kamil Remove code for AIX, including hack for 3.2.5 (from 1997) - from ksh(1)

OK by <kre>
 1.11 22-Jun-2017  kamil Drop HP-UX support from ksh(1)

OK by <kre>
 1.10 22-Jun-2017  kamil Remove sco unix 3.2v4.1 support (from 1992) from ksh(1)

OK by <kre>
 1.9 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.8 19-Aug-2004  christos Handle RESCUEDIR
 1.7 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.6 11-Nov-2002  jdolecek default to "$HOME/.kshrc" if ENV is not set
 1.5 04-Feb-2001  christos we do have dup2.
 1.4 12-Jan-1997  tls branches: 1.4.12;
RCS ID Police
 1.3 09-Oct-1996  jtc sync with 5.2.11 (now define POSIXLY_CORRECT)
 1.2 09-Oct-1996  jtc autoconf biffed a test --- our stat macros do work
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.3 09-Oct-1996  jtc import pdksh 5.2.11
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.4.12.1 26-Feb-2002  he Pull up revision 1.5 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.53.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.53.6.1 21-Apr-2020  martin Sync with HEAD
 1.36 03-Oct-2024  rillig bin: fix lint warning "effectively discards 'const'"

For example: src/bin/ed/io.c(339): warning: call to 'strchr' effectively
discards 'const' from argument [346]

No binary change.
 1.35 03-Jun-2018  kamil branches: 1.35.2; 1.35.14;
ksh: Remove symbol clash with libc

Rename local function twalk() to ksh_twak().
This is needed for installing interceptors in sanitizers.

Sponsored by <The NetBSD Foundation>
 1.34 01-Jul-2017  joerg branches: 1.34.4;
Kill enough K&R cruft to build with clang again.
 1.33 30-Jun-2017  kamil ksh: Eliminate dead function x_complete_word()
 1.32 30-Jun-2017  kamil ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.31 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.30 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.29 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.28 22-Jun-2017  kamil Remove sco unix 3.2v4.1 support (from 1992) from ksh(1)

OK by <kre>
 1.27 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.26 22-Jun-2017  kamil Remove ancient cygwin support in ksh(1)

OK by <kre>
 1.25 05-Jun-2010  sjg PR: 39604
Reviewed by:

add_glob:
Do not stop scanning if we see '$' as it does more harm than good.
For $HOME/tm we should return $HOME/tm*
 1.24 02-Apr-2010  plunky - int putbuf_func ARGS((const char *s, size_t len));
+ int (*putbuf_func) ARGS((const char *, size_t));

for pcc
- did not recognise pointer to function
- argument names shadowed other arguments
 1.23 24-Nov-2009  seanb Back out fix for PR 22846 as it has issues. See PR 22846 for details.
 1.22 25-Apr-2009  lukem Fix most of the -Wsign-compare issues.
 1.21 28-Jan-2007  cbiere branches: 1.21.20;
* Escape '?', '[', ']' like other meta characters.
* Partial fix for completion when '[' is in the way.
* Addresses PR bin/22846.
 1.20 14-May-2006  christos Don't free random memory; thanks gcc-4.
 1.19 27-Apr-2006  christos Avoid double free.
 1.18 24-Apr-2006  christos Coverity CID 2995: Fix memory leak.
 1.17 11-Sep-2005  christos Process window size changes after xread(). [change window size]
echo $COLUMS $LINES; will now print the new sizes immediately, instead
of after the second echo. From otto@OpenBSD
 1.16 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.15 23-May-2005  rillig Fixed wrong use of the <ctype.h> functions by adding (unsigned char) casts.
 1.14 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.13 11-Sep-2003  jmmv Add ':' to the list of characters to be escaped. Fixes completion problems
when the filename includes this character.
 1.12 26-Aug-2003  wiz From OpenBSD:
revision 1.18
date: 2003/08/22 18:17:10; author: fgsch; state: Exp; lines: +2 -2
in word location, fix forward scanning so it correctly account for any
escaped char and not only spaces.
for "foo (bar.a)" and "foo (bar a)", cd foo\ \(bar.<tab> will correctly
expand to foo\ \(bar.a\).
otto@ and pval@ ok.
 1.11 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.10 07-May-2003  wiz Fix completion of files containing #. From Soren Jacobsen in PR 21486.
 1.9 06-May-2003  wiz Add ` (backquote) to quoted characters for completion. From fgsch@openbsd.
Okayed by christos.
 1.8 25-Sep-2002  provos change complete-list to first complete and then print a list,
also complete after '=' (dd), and ':' (ssh) and ` (backtick)
improvements from camield@openbsd.org. approved by perry and thorpej.
 1.7 25-Jan-2002  sjg Fix some aspects of globbing - in emacs mode at least.
echo ~<ESC><ESC> and $HOME<ESC><ESC> as well as ~/b<ESC><ESC> all
now expand correctly.
 1.6 02-Nov-1999  jdolecek branches: 1.6.6;
Implement (somewhat enhanced) idea stealed from bash:
when completing the filename (either in vi mode with vi-tabcomplete on,
or in emacs mode after double esc), escape any shell special characters
and chars from $IFS with backslash - very handy especially when
dealing with filenames containing spaces

The patch has been sent to maintainer, but I haven't got any reply yet even
after about a month :(
 1.5 20-Oct-1999  hubertf resolve conflicts
 1.4 04-Nov-1998  christos branches: 1.4.4;
char->unsigned char casts for is*()
 1.3 20-Jul-1997  christos Fix compiler warnings
Add WARNS=1
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.3 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.4.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.6.1 06-Feb-2002  he Pull up revision 1.7 (requested by sjg):
Fix some aspects of globbing, particularly in emacs mode.
 1.21.20.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.34.4.1 25-Jun-2018  pgoyette Sync with HEAD
 1.35.14.1 02-Aug-2025  perseant Sync with HEAD
 1.35.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.35.2.1 21-Apr-2020  martin Sync with HEAD
 1.5 01-Jul-2017  joerg branches: 1.5.6;
Kill enough K&R cruft to build with clang again.
 1.4 30-Jun-2017  kamil ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.3 02-Nov-1999  jdolecek Implement (somewhat enhanced) idea stealed from bash:
when completing the filename (either in vi mode with vi-tabcomplete on,
or in emacs mode after double esc), escape any shell special characters
and chars from $IFS with backslash - very handy especially when
dealing with filenames containing spaces

The patch has been sent to maintainer, but I haven't got any reply yet even
after about a month :(
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.5.6.1 21-Apr-2020  martin Sync with HEAD
 1.4 25-Oct-2008  apb branches: 1.4.62;
In shell scripts run during the build, add a SED variable, defaulting
to "sed". SED=${TOOL_SED:Q} should be passed in the environment to
override this.
 1.3 19-Oct-2008  apb In shell scripts invoked during a build, and in crunchgen, use ${AWK}
instead of plain "awk". The Makefiles that invoke these scripts
or programs will pass AWK=${HOST_AWK:Q}.
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.4.62.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.4.62.1 21-Apr-2020  martin Sync with HEAD
 1.38 08-May-2018  kamil branches: 1.38.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.37 30-Jun-2017  kamil branches: 1.37.4;
ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.36 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.35 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.34 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.33 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.32 25-Apr-2009  lukem Fix most of the -Wsign-compare issues.
 1.31 13-May-2006  christos branches: 1.31.28;
Coverity CID 3365: Fix inverted logic!
 1.30 01-Apr-2006  christos Coverity CID 1829: Fix memory leak.
 1.29 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.28 23-May-2005  rillig Fixed wrong use of the <ctype.h> functions by adding (unsigned char) casts.
 1.27 11-Feb-2005  simonb White space nit- don't put a space before/after increment/decrement
operators.
 1.26 28-Oct-2004  dsl Add (unsigned char) casts to tolower/toupper and iscntrl calls.
Fixes PR 27593
 1.25 07-Jul-2004  mycroft Truncate the prompt if too long. Fixes PR 24674, but not with the patch from
there.
 1.24 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.23 26-Feb-2004  jdolecek rename variable 'history' to 'histlist' to avoid clash with libedit
history() when this program is crunched into /rescue tools

fixes PR bin/24556 by Kouichirou Hiratsuka
 1.22 28-Aug-2003  wiz In emacs mode, when expanding file names containing characters that should
get quoted with <ESC>*, _do_ quote them.
Patch from Federico Schwindt fgsch@openbsd -- thanks!
[rev 1.25 in OpenBSD version of this file]
 1.21 26-Aug-2003  wiz Push (into yank buffer) words only if force_push is TRUE;
set force_push to TRUE in x_del_bword and x_del_fword.
Fixes behaviour where <meta-y> would put the previously yanked word in the yank buffer another time.
 1.20 26-Aug-2003  wiz From OpenBSD:
revision 1.21
date: 2003/08/02 19:26:15; author: fgsch; state: Exp; lines: +4 -2
On ESC-y ESC-y (yank-pop), also check that there is something to
insert (some text has been killed before). from otto@, fix bug report 3384.

On yank-pop error (no yank before), reset the index to killstack so
another yank-pop does not mangle the prompt if nothing was yanked, and
to avoid replacing a text when it shouldn't
(yank <something> yank-pop yank-pop).
otto@ ok.
 1.19 26-Aug-2003  wiz Allow single letters to be yanked, not only words of two or more letters.
 1.18 26-Aug-2003  wiz Add 'return' statement (and whitespace) to sync with OpenBSD version
of the patch committed in v1.12.
 1.17 26-Aug-2003  wiz From OpenBSD:
revision 1.23
date: 2003/08/23 02:30:59; author: fgsch; state: Exp; lines: +2 -2
under emacs mode, fix the case when the globbed file and the longest
prefix lenghts are equal ("a .b" and "a ab" by instance).
found and tested by otto@.
 1.16 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.15 10-Oct-2002  provos enable meta key in emacs mode for 7-bit locales. approved thorpej.
 1.14 27-Sep-2002  provos complete file names including a ~ correctly.
 1.13 25-Sep-2002  provos enable emacs mode, add tab key to do completion in emacs and vi mode.
from millert@openbsd.org. approved by perry and thorpej.
 1.12 25-Sep-2002  provos change complete-list to first complete and then print a list,
also complete after '=' (dd), and ':' (ssh) and ` (backtick)
improvements from camield@openbsd.org. approved by perry and thorpej.
 1.11 25-Jan-2002  sjg Fix some aspects of globbing - in emacs mode at least.
echo ~<ESC><ESC> and $HOME<ESC><ESC> as well as ~/b<ESC><ESC> all
now expand correctly.
 1.10 09-Nov-1999  jdolecek branches: 1.10.4;
remove debug printf accidentaly left in
 1.9 08-Nov-1999  jdolecek in emacs mode, escape the contents of completed word appropriately even
in CT_COMPLIST case ("complete and then list (if non-exact)" mode)

Noticed by Soren S. Jorvang <soren@wheel.dk>.
 1.8 02-Nov-1999  jdolecek Implement (somewhat enhanced) idea stealed from bash:
when completing the filename (either in vi mode with vi-tabcomplete on,
or in emacs mode after double esc), escape any shell special characters
and chars from $IFS with backslash - very handy especially when
dealing with filenames containing spaces

The patch has been sent to maintainer, but I haven't got any reply yet even
after about a month :(
 1.7 20-Oct-1999  hubertf make this build with -Werror
 1.6 20-Oct-1999  hubertf resolve conflicts
 1.5 04-Nov-1998  christos branches: 1.5.4;
char->unsigned char casts for is*()
 1.4 29-Mar-1998  mrg - change "register" variables into int's
- don't use char as an array index.
 1.3 20-Jul-1997  christos Fix compiler warnings
Add WARNS=1
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.5.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.4.1 06-Feb-2002  he Pull up revision 1.11 (requested by sjg):
Fix some aspects of globbing, particularly in emacs mode.
 1.31.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.37.4.1 21-May-2018  pgoyette Sync with HEAD
 1.38.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.38.2.1 21-Apr-2020  martin Sync with HEAD
 1.27 03-Oct-2024  rillig bin: fix lint warning "effectively discards 'const'"

For example: src/bin/ed/io.c(339): warning: call to 'strchr' effectively
discards 'const' from argument [346]

No binary change.
 1.26 26-Sep-2019  mlelstv branches: 1.26.10;
Fix FALLTHROUGH comments.
 1.25 12-Jun-2018  kamil branches: 1.25.2;
Change typ of tilde_ok from int to unsigned int in ksh(1)

UBSan can detect that during switching a login to root there is unportable
left shift operation:

$ su -
Password:
/public/src.git/bin/ksh/eval.c:598:13: runtime error: left shift of 1073741824 by 1 places cannot be represented in type 'int'
#

Sponsored by <The NetBSD Foundation>
 1.24 03-Jun-2018  kamil ksh: Remove symbol clash with libc

Rename local function glob() to ksh_glob().
This is needed for installing interceptors in sanitizers.

Sponsored by <The NetBSD Foundation>
 1.23 08-May-2018  kamil Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.22 30-Jun-2017  kamil branches: 1.22.4;
ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.21 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.20 30-Jun-2017  kamil ksh: Drop support for systems without handling shebang
 1.19 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.18 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.17 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.16 04-Oct-2016  joerg Add explicit char cast to show that the value change is intended.
 1.15 18-Oct-2013  christos branches: 1.15.8;
Fixed unused warnings.
 1.14 21-Aug-2011  dholland branches: 1.14.2; 1.14.8;
Requires stdint.h.
 1.13 14-Aug-2011  christos kill gcc-4.5 hack.
 1.12 24-Nov-2009  seanb Back out fix for PR 22846 as it has issues. See PR 22846 for details.
 1.11 25-Apr-2009  lukem Fix most of the -Wsign-compare issues.
 1.10 28-Jan-2007  cbiere branches: 1.10.20;
Applied patch by Arto Huusko from PR bin/24753 to append a slash to "."
and ".." instead of skipping over them fixing completion for patterns
like ".*" and "..*".
 1.9 28-Jan-2007  cbiere * Escape '?', '[', ']' like other meta characters.
* Partial fix for completion when '[' is in the way.
* Addresses PR bin/22846.
 1.8 28-Jan-2007  cbiere Committed patch from PR bin/34755: Append a slash when expanding ~user
to user's home directory.
 1.7 13-May-2006  christos Coverity CID 3368: Fix memory leak.
 1.6 10-May-2006  mrg quell GCC 4.1 uninitialised variable warnings.

XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..
 1.5 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.4 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.3 20-Oct-1999  hubertf resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.20.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.14.8.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.15.8.1 04-Nov-2016  pgoyette Sync with HEAD
 1.22.4.2 25-Jun-2018  pgoyette Sync with HEAD
 1.22.4.1 21-May-2018  pgoyette Sync with HEAD
 1.25.2.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.25.2.2 21-Apr-2020  martin Sync with HEAD
 1.25.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.26.10.1 02-Aug-2025  perseant Sync with HEAD
 1.28 03-Jun-2018  kamil branches: 1.28.2;
ksh: Remove symbol clash with libc

Rename local function twalk() to ksh_twak().
This is needed for installing interceptors in sanitizers.

Sponsored by <The NetBSD Foundation>
 1.27 08-May-2018  kamil Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.26 24-Jan-2018  kamil branches: 1.26.2;
ksh: Rename a local function tsearch to mytsearch

This removes a clash with well-known libc function tsearch(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by <The NetBSD Foundation>
 1.25 24-Jan-2018  kamil ksh: Rename a local function tdelete to mytdelete

This removes a clash with well-known libc function tdelete(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by <The NetBSD Foundation>
 1.24 01-Jul-2017  joerg Kill enough K&R cruft to build with clang again.
 1.23 30-Jun-2017  kamil ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.22 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.21 30-Jun-2017  kamil ksh: Drop support for systems without functional waitpid(2)
 1.20 30-Jun-2017  kamil ksh: Drop support for systems without handling shebang
 1.19 22-Jun-2017  kamil ksh: Drop support for ISC UNIX
 1.18 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.17 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.16 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.15 25-Mar-2012  christos PR/6764: Charles M. Hannum: `trap 0' does not work in ksh subshells. When
subshells exit normally, use unwind(LEXIT) instead of unwind(LLEAVE) so that
traps get executed.
 1.14 16-Oct-2011  joerg branches: 1.14.2;
Don't use non-literal format strings.
 1.13 24-Apr-2006  christos Coverity CID 2994: Don't leak memory in the perm case.
 1.12 11-Sep-2005  christos The following should print \"; from OpenBSD
$ cat << EOF
\"
EOF
 1.11 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.10 19-Apr-2005  rillig Fixed wrong use of the <ctype.h> functions by adding an explicit conversion
to unsigned char. Approved by christos.
 1.9 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.8 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.7 25-Sep-2002  provos change complete-list to first complete and then print a list,
also complete after '=' (dd), and ':' (ssh) and ` (backtick)
improvements from camield@openbsd.org. approved by perry and thorpej.
 1.6 29-Sep-2001  wiz Bring in pdksh-5.2.14-patches.2.
ChangeLog entry:
Mon Jan 29 10:12:31 NST 2001 Michael Rendell (michael@garfield.cs.mun.ca)
* c_exec.c(execute): added rv_prop flag to prevent if/while/for/...
in the presence of "set -e" from causing the shell to exit.
Example:
set -e
(false && echo hi)
[exits shell though it shouldn't]
ChangeLog and example provided by pdksh maintainer, Michael Rendell.
 1.5 20-Oct-1999  hubertf branches: 1.5.6;
resolve conflicts
 1.4 28-Jul-1998  mycroft branches: 1.4.4;
Delint.
 1.3 20-Jul-1997  christos Fix compiler warnings
Add WARNS=1
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.4 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.3 18-Dec-1996  jtc import pdksh 5.2.12
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.4.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.6.1 26-Feb-2002  he Pull up revision 1.6 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.14.2.1 17-Apr-2012  yamt sync with head
 1.26.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.26.2.1 21-May-2018  pgoyette Sync with HEAD
 1.28.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.28.2.1 21-Apr-2020  martin Sync with HEAD
 1.7 08-May-2018  kamil branches: 1.7.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.6 30-Jun-2017  kamil branches: 1.6.4;
ksh: Eliminate dead code from expand.h
 1.5 18-Oct-2013  christos Fixed unused warnings.
 1.4 26-Jul-2001  wiz branches: 1.4.58; 1.4.64;
Various typos in comments (neccessary, sceme, choise, ...).
 1.3 20-Oct-1999  hubertf branches: 1.3.6;
resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.6.1 26-Feb-2002  he Pull up revision 1.4 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.4.64.1 19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.4.58.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.6.4.1 21-May-2018  pgoyette Sync with HEAD
 1.7.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.7.2.1 21-Apr-2020  martin Sync with HEAD
 1.13 03-Jul-2022  kre Fix core dump caused by
ksh -c '(i=10; echo $((++-+++i)))'
reported by Steffen Nurpmeso (not on a NetBSD list or PR).

Seems pointless to fix just one of the bugs in this thing, but this one was
easy enough (and stupid enough). (The "i=10" part is unimportant, as is the sub-shell).
 1.12 08-May-2018  kamil branches: 1.12.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.11 01-Jul-2017  joerg branches: 1.11.4;
Kill enough K&R cruft to build with clang again.
 1.10 30-Jun-2017  kamil ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.9 16-Oct-2011  joerg Don't use non-literal format strings.
 1.8 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.7 19-Apr-2005  rillig Fixed wrong use of the <ctype.h> functions by adding an explicit conversion
to unsigned char. Approved by christos.
 1.6 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.5 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.4 20-Oct-1999  hubertf make this build with -Werror
 1.3 20-Oct-1999  hubertf resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.11.4.1 21-May-2018  pgoyette Sync with HEAD
 1.12.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.12.2.1 21-Apr-2020  martin Sync with HEAD
 1.20 08-Sep-2024  rillig s/effect/affect/ in a few places
 1.19 08-May-2018  kamil branches: 1.19.2; 1.19.14;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.18 17-Jan-2018  maya branches: 1.18.2;
Use 0600 as the mode for histfile here too.

pointed out by John D. Baker in PR bin/52480
 1.17 30-Jun-2017  kamil ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.16 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.15 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.14 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.13 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.12 14-Jan-2017  maya branches: 1.12.6;
reorganize the code so we test if open fails at the open call.
this doesn't actually make a functional difference as ftruncate can
handle it, but it's a bit clearer and appeases static analyzers.

ok riastradh
 1.11 31-Aug-2011  plunky branches: 1.11.4; 1.11.10; 1.11.18; 1.11.22; 1.11.24; 1.11.26; 1.11.30;
NULL does not need a cast
 1.10 31-Oct-2009  dsl Avoid generating a corrupt history file if multiple ksh exit together.
Fixes PR/28912
 1.9 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.8 16-Jul-2004  christos PR/26339: Pavel Cahyna: the 'fc' command can crash non-interactive ksh
Produce an error message instead.
 1.7 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.6 26-Feb-2004  jdolecek rename variable 'history' to 'histlist' to avoid clash with libedit
history() when this program is crunched into /rescue tools

fixes PR bin/24556 by Kouichirou Hiratsuka
 1.5 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.4 20-Oct-1999  hubertf resolve conflicts
 1.3 20-Jul-1997  christos branches: 1.3.6;
Fix compiler warnings
Add WARNS=1
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.11.30.1 22-Jan-2018  snj Pull up following revision(s) (requested by maya in ticket #1554):
bin/ksh/history.c: revision 1.18 via patch
Use 0600 as the mode for histfile here too.
pointed out by John D. Baker in PR bin/52480
 1.11.26.1 20-Mar-2017  pgoyette Sync with HEAD
 1.11.24.1 22-Jan-2018  snj Pull up following revision(s) (requested by maya in ticket #1554):
bin/ksh/history.c: revision 1.18 via patch
Use 0600 as the mode for histfile here too.
pointed out by John D. Baker in PR bin/52480
 1.11.22.1 22-Jan-2018  snj Pull up following revision(s) (requested by maya in ticket #1554):
bin/ksh/history.c: revision 1.18 via patch
Use 0600 as the mode for histfile here too.
pointed out by John D. Baker in PR bin/52480
 1.11.18.1 13-Mar-2018  snj Pull up following revision(s) (requested by maya in ticket #1520):
bin/ksh/history.c: 1.18
Use 0600 as the mode for histfile here too.
pointed out by John D. Baker in PR bin/52480
 1.11.10.1 13-Mar-2018  snj Pull up following revision(s) (requested by maya in ticket #1520):
bin/ksh/history.c: 1.18
Use 0600 as the mode for histfile here too.
pointed out by John D. Baker in PR bin/52480
 1.11.4.1 13-Mar-2018  snj Pull up following revision(s) (requested by maya in ticket #1520):
bin/ksh/history.c: 1.18
Use 0600 as the mode for histfile here too.
pointed out by John D. Baker in PR bin/52480
 1.12.6.1 22-Jan-2018  martin Pull up following revision(s) (requested by maya in ticket #505):
bin/ksh/history.c: revision 1.18
Use 0600 as the mode for histfile here too.
pointed out by John D. Baker in PR bin/52480
 1.18.2.1 21-May-2018  pgoyette Sync with HEAD
 1.19.14.1 02-Aug-2025  perseant Sync with HEAD
 1.19.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.19.2.1 21-Apr-2020  martin Sync with HEAD
 1.18 08-May-2018  kamil branches: 1.18.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.17 30-Jun-2017  kamil branches: 1.17.4;
ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.16 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.15 30-Jun-2017  kamil ksh: Assume ANSI C prototypes
 1.14 23-Jun-2017  kamil ksh: Use ANSI C varargs, drop support for older version <varargs.h>
 1.13 22-Jun-2017  kamil Drop Ultrix support from ksh(1), a DEC UNIX for VAX
 1.12 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.11 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.10 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.9 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.8 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.7 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.6 16-Sep-2001  wiz Spell 'occurred' with two 'r's.
 1.5 20-Oct-1999  hubertf branches: 1.5.6;
resolve conflicts
 1.4 04-Nov-1998  christos branches: 1.4.4;
char->unsigned char casts for is*()
 1.3 19-Aug-1998  thorpej Add some braces to make egcs happy.
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.4.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.6.1 26-Feb-2002  he Pull up revision 1.6 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.17.4.1 21-May-2018  pgoyette Sync with HEAD
 1.18.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.18.2.1 21-Apr-2020  martin Sync with HEAD
 1.19 30-Jun-2017  kamil branches: 1.19.6;
ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.18 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.17 30-Jun-2017  kamil ksh: Drop support for systems with broken times(3)

This fallback code wouldn't work anyway.

times(3) is an obsolete interface by getrusage(2) and gettimeofday(2).
In future it will be swiched to more modern interfaces.

No functional change intended.
 1.16 30-Jun-2017  kamil ksh: Drop support for systems without functional waitpid(2)
 1.15 30-Jun-2017  kamil ksh: Drop ksh_wait.h that reinvents <sys/wait.h> (POSIX header)

Switch jobs.c to <sys/wait.h>.

No functional change intended.
 1.14 23-Jun-2017  kamil ksh: Replace homegrown int_least32_t with the C99 version
 1.13 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.12 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.11 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.10 16-Oct-2011  joerg Don't use non-literal format strings.
 1.9 25-Feb-2006  wiz Fix typos, reported by Alexey Dobriyan ("Gathered from Linux"),
forwarded by jmc@openbsd.
 1.8 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.7 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.6 02-Nov-2000  christos PR/11361:Matthias Buelow: Apply patch1 from pdksh site.
- set -x dumps core (shf.c);
- output of "jobs" command is filled with ^A characters (jobs.c);
- "typeset -r foo=bar" fails saying foo is readonly (var.c).
 1.5 20-Oct-1999  hubertf branches: 1.5.6;
resolve conflicts
 1.4 19-Aug-1998  thorpej branches: 1.4.4;
Add some braces to make egcs happy.
 1.3 07-Apr-1998  fair change some /dev/tty to paths.h _PATH_TTY
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.4 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.3 18-Dec-1996  jtc import pdksh 5.2.12
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.4.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.6.1 26-Feb-2002  he Pull up revision 1.6 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.19.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.19.6.1 21-Apr-2020  martin Sync with HEAD
 1.3 20-Oct-1999  hubertf this is now generated automatically
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.3 18-Dec-1996  jtc import pdksh 5.2.12
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.30 08-Sep-2024  rillig s/effect/affect/ in a few places
 1.29 21-Aug-2022  uwe branches: 1.29.4;
ksh(1): fix pasto in the description of the -l option.
 1.28 07-Aug-2022  andvar fix various typos in comments, documentation and messages.
mainly s/paramater/parameter/ and s/reduntant/redundant/.
 1.27 30-Oct-2021  andvar "no affect" -> "no effect" in man pages and comments.
 1.26 26-Aug-2018  sevan Add -l to SYNOPSIS
 1.25 30-Dec-2015  christos branches: 1.25.8; 1.25.14; 1.25.16;
We don't have RLIMIT_SWAP
 1.24 12-Apr-2015  jmcneill document ulimit -r
 1.23 18-Oct-2011  reed Fix typo.
From Snader_LB on IRC.
 1.22 24-Oct-2009  reed Show that -l is option for bind builtin.
(The -l is described later.)
 1.21 27-Oct-2008  apb In foo="`echo \"hi\"`", the backslashes should be removed by the outer
double quotes, not seen by the inner backquotes. Previously, ksh(1)
handled this correctly in non-posix mode but incorrectly in posix mode.

The previous comments in src/bin/ksh/lex.c quote parts of some version
of the POSIX specification. The version of POSIX being quoted is not
identified, but the wording is very similar to that in SUSv3
<http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html>.

It seems clear that the words "having escape characters removed"
mean, in that context, that the backslash before the double quote in
"...`...\"...`..." is removed as part of the handling of the outer
double quotes, so that the backslash is not present when the inner
backquotes are handled. The new code in this commit follows this
interpretation. The previous code followed a different interpretation
which is now believed to be incorrect.

Discussed in tech-userlevel. Closes PR 26493.
 1.20 30-Jul-2007  mjf branches: 1.20.14;
Fix some grammatical errors in man pages.
Patch supplied by Joerg Niendorf in PR misc/36707, thanks.
 1.19 24-Oct-2006  cbiere Applied patch from PR bin/34790 so that ~/.kshrc is mentioned.
 1.18 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.17 17-Apr-2004  christos understand rlimit sbsize
 1.16 13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.15 01-May-2003  wiz Some grammar and punctuation fixes from jmc@openbsd.
 1.14 29-Mar-2003  perry reimplementation -> re-implementation
 1.13 22-Mar-2003  kristerw Fix some typos noted by Soren Jacobsen in PR 20793.
 1.12 05-Dec-2002  wiz Fix typo.
 1.11 12-Oct-2002  wiz Miscellaneous fixes by Martin Weber (ephaeton at that gmx net thingy).
 1.10 02-Oct-2002  wiz parameter, not paramter. By Adrian Mrva.
 1.9 26-Sep-2002  wiz Begin new sentences on new lines. From Robert Elz (kre at munnari oz au).
 1.8 25-Sep-2002  provos enable emacs mode, add tab key to do completion in emacs and vi mode.
from millert@openbsd.org. approved by perry and thorpej.
 1.7 20-Sep-2002  jschauma comment out the (no longer) builtin newgrp
 1.6 29-Jan-2002  wiz Fix bin/5205 (weird interaction between tbl and man macros).
 1.5 11-Nov-2001  jwise Fix a cross reference in man page. This should probably be mandoc-ified
if we are not going to use reachover makefiles for ksh (and given that
pdksh does not update very frequently (at all? any more? at the moment?),
it is probably reasonable not to).
 1.4 20-Aug-2001  wiz precede, not preceed.
 1.3 11-Jun-2001  wiz Fix various misspellings of compatible/compatibility.
 1.2 09-Apr-2001  wiz environ(7), not (5); add RCS Id; whitespace fixes.
 1.1 20-Oct-1999  hubertf branches: 1.1.1;
Initial revision
 1.1.1.1 20-Oct-1999  hubertf branches: 1.1.1.1.4; 1.1.1.1.6;
Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1.6.2 26-Feb-2002  he Pull up revisions 1.3-1.6 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.1.1.1.6.1 26-Apr-2001  he Pull up revision 1.2 (requested by wiz):
Correct environ(7) reference, add RCS Id, whitespace fixes.
 1.1.1.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.20.14.2 30-Jul-2007  mjf Fix some grammatical errors in man pages.
Patch supplied by Joerg Niendorf in PR misc/36707, thanks.
 1.20.14.1 30-Jul-2007  mjf file ksh.Man was added on branch matt-mips64 on 2007-07-30 18:01:43 +0000
 1.25.16.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.25.16.2 21-Apr-2020  martin Sync with HEAD
 1.25.16.1 10-Jun-2019  christos Sync with HEAD
 1.25.14.1 06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.25.8.1 28-Aug-2018  martin Pull up following revision(s) (requested by sevan in ticket #992):

external/bsd/top/dist/top.1.in: revision 1.11
sbin/gpt/main.c: revision 1.12
sbin/amrctl/amrctl.c: revision 1.11
bin/df/df.c: revision 1.93
sbin/fsck_ext2fs/fsck_ext2fs.8: revision 1.21
sbin/fsck_ext2fs/main.c: revision 1.38
bin/ksh/ksh.Man: revision 1.26
bin/ln/ln.c: revision 1.40
bin/df/df.1: revision 1.48
bin/df/df.1: revision 1.49

Document the WCPU field.

Match SYNOPSIS with usage()

-G cannot be specified alongside -i or -P.
Heads up by <leot>

Add -l to SYNOPSIS

Update usage to include -w

Match sequence as per SYNOPSIS in manual

Remove reference to -c flag which was never implemented.

Remove references to -c flag which was never included.

Add the -T flag to usage()
 1.29.4.1 02-Aug-2025  perseant Sync with HEAD
 1.2 12-Jan-1997  tls branches: 1.2.112;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.112.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.2.112.1 21-Apr-2020  martin Sync with HEAD
 1.2 12-Jan-1997  tls branches: 1.2.112;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.112.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.2.112.1 21-Apr-2020  martin Sync with HEAD
 1.4 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.3 30-Jun-2017  kamil ksh: Drop support for systems without POSIX lstat(2)
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.3 30-Jun-2017  kamil ksh: Drop support for systems with broken <sys/time.h> / <time.h>
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.3 30-Jun-2017  kamil ksh: Drop support for systems with broken times(3)

This fallback code wouldn't work anyway.

times(3) is an obsolete interface by getrusage(2) and gettimeofday(2).
In future it will be swiched to more modern interfaces.

No functional change intended.
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.3 30-Jun-2017  kamil ksh: Drop ksh_wait.h that reinvents <sys/wait.h> (POSIX header)

Switch jobs.c to <sys/wait.h>.

No functional change intended.
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.24 26-Sep-2019  mlelstv Fix FALLTHROUGH comments.
 1.23 08-May-2018  kamil branches: 1.23.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.22 24-Jan-2018  kamil branches: 1.22.2;
ksh: Rename a local function tsearch to mytsearch

This removes a clash with well-known libc function tsearch(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by <The NetBSD Foundation>
 1.21 30-Jun-2017  kamil ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.20 30-Jun-2017  kamil ksh: Assume ANSI C prototypes
 1.19 23-Jun-2017  kamil ksh: Use ANSI C varargs, drop support for older version <varargs.h>
 1.18 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.17 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.16 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.15 16-Oct-2011  joerg Don't use non-literal format strings.
 1.14 23-Jan-2011  hauke The previous commit removed a { }�block, and unintendedly introduced a
C99ism (inlined variable declaration), which hurts when pdksh is used
for bootstrapping pkgsrc. Move the two declarations to the beginning
of the block.
 1.13 27-Oct-2008  apb branches: 1.13.14;
In foo="`echo \"hi\"`", the backslashes should be removed by the outer
double quotes, not seen by the inner backquotes. Previously, ksh(1)
handled this correctly in non-posix mode but incorrectly in posix mode.

The previous comments in src/bin/ksh/lex.c quote parts of some version
of the POSIX specification. The version of POSIX being quoted is not
identified, but the wording is very similar to that in SUSv3
<http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html>.

It seems clear that the words "having escape characters removed"
mean, in that context, that the backslash before the double quote in
"...`...\"...`..." is removed as part of the handling of the outer
double quotes, so that the backslash is not present when the inner
backquotes are handled. The new code in this commit follows this
interpretation. The previous code followed a different interpretation
which is now believed to be incorrect.

Discussed in tech-userlevel. Closes PR 26493.
 1.12 11-Sep-2005  christos The following should print \"; from OpenBSD
$ cat << EOF
\"
EOF
 1.11 19-Apr-2005  rillig Fixed wrong use of the <ctype.h> functions by adding an explicit conversion
to unsigned char. Approved by christos.
 1.10 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.9 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.8 20-Jan-2003  simonb The Double-Semi-Colon Police.
 1.7 20-Oct-1999  hubertf make this build with -Werror
 1.6 20-Oct-1999  hubertf resolve conflicts
 1.5 04-Nov-1998  christos branches: 1.5.4;
char->unsigned char casts for is*()
 1.4 19-Aug-1998  thorpej Add some braces to make egcs happy.
 1.3 20-Jul-1997  christos Fix compiler warnings
Add WARNS=1
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.5 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.4 18-Dec-1996  jtc import pdksh 5.2.12
 1.1.1.3 09-Oct-1996  jtc import pdksh 5.2.11
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.5.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.13.14.1 08-Feb-2011  bouyer Sync with HEAD
 1.22.2.1 21-May-2018  pgoyette Sync with HEAD
 1.23.2.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.23.2.2 21-Apr-2020  martin Sync with HEAD
 1.23.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.7 11-Sep-2005  christos branches: 1.7.86;
The following should print \"; from OpenBSD
$ cat << EOF
\"
EOF
 1.6 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.5 26-Feb-2004  jdolecek rename variable 'history' to 'histlist' to avoid clash with libedit
history() when this program is crunched into /rescue tools

fixes PR bin/24556 by Kouichirou Hiratsuka
 1.4 16-Sep-2001  wiz Spell 'occurred' with two 'r's.
 1.3 20-Oct-1999  hubertf branches: 1.3.6;
resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.4 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.3 09-Oct-1996  jtc import pdksh 5.2.11
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.6.1 26-Feb-2002  he Pull up revision 1.4 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.7.86.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.7.86.1 21-Apr-2020  martin Sync with HEAD
 1.9 08-May-2018  kamil branches: 1.9.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.8 30-Jun-2017  kamil branches: 1.8.4;
ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.7 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.6 30-Jun-2017  kamil ksh: Drop support for systems with broken <sys/time.h> / <time.h>
 1.5 15-Jan-2006  jschauma Start 'You have mail in' with a capital Y.
 1.4 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.3 20-Oct-1999  hubertf resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.4.1 21-May-2018  pgoyette Sync with HEAD
 1.9.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.9.2.1 21-Apr-2020  martin Sync with HEAD
 1.23 08-May-2018  kamil branches: 1.23.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.22 30-Jun-2017  kamil branches: 1.22.4;
ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.21 30-Jun-2017  kamil ksh: Eliminate dead MEM_DEBUG sections, there is missing code for it

MEM_DEBUG used to contain malloc(3) debugging facilities.
 1.20 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.19 30-Jun-2017  kamil ksh: Drop support for systems with broken <sys/time.h> / <time.h>
 1.18 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.17 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.16 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.15 16-Oct-2011  joerg Don't use non-literal format strings.
 1.14 24-Jun-2007  christos PR/36546: Aleksey Cheusov: problems with 8-bit input in /bin/ksh, needs to
call setlocale()
 1.13 13-May-2006  christos branches: 1.13.4; 1.13.6;
Coverity CID 3369: Fix memory leak.
 1.12 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.11 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.10 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.9 25-Sep-2002  provos enable emacs mode, add tab key to do completion in emacs and vi mode.
from millert@openbsd.org. approved by perry and thorpej.
 1.8 20-Sep-2002  jschauma We don't have 'newgrp' -> ifdef the builtin alias. This prevents
the shell from unexpectedly dying if a user enters the (nonexistent)
'newgrp' command. OK'd by perry.
As seen in OpenBSD.
 1.7 11-Jul-2002  wiz 'environment', not 'enviroment'
 1.6 20-Oct-1999  hubertf branches: 1.6.6; 1.6.8;
resolve conflicts
 1.5 19-Aug-1998  thorpej branches: 1.5.4;
Add some braces to make egcs happy.
 1.4 28-Jul-1998  mycroft Delint.
 1.3 20-Jul-1997  christos Fix compiler warnings
Add WARNS=1
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.4 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.3 18-Dec-1996  jtc import pdksh 5.2.12
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.5.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.8.1 14-Oct-2002  lukem Pull up revision 1.8 (requested by jschauma in ticket #910):
We don't have 'newgrp' -> ifdef the builtin alias. This prevents
the shell from unexpectedly dying if a user enters the (nonexistent)
'newgrp' command. OK'd by perry.
As seen in OpenBSD.
 1.6.6.1 18-Oct-2002  itojun bin/ksh/main.c 1.8

Prevent ksh from dying if a user enters the (nonexistent) 'newgrp' command.
 1.13.6.1 03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.13.4.1 01-Jul-2007  bouyer Pull up following revision(s) (requested by christos in ticket #749):
bin/ksh/main.c: revision 1.14
PR/36546: Aleksey Cheusov: problems with 8-bit input in /bin/ksh, needs to
call setlocale()
 1.22.4.1 21-May-2018  pgoyette Sync with HEAD
 1.23.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.23.2.1 21-Apr-2020  martin Sync with HEAD
 1.26 03-Oct-2024  rillig bin: fix lint warning "effectively discards 'const'"

For example: src/bin/ed/io.c(339): warning: call to 'strchr' effectively
discards 'const' from argument [346]

No binary change.
 1.25 29-Oct-2019  joerg branches: 1.25.10;
Avoid arithmetics on strings.
 1.24 08-May-2018  kamil branches: 1.24.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.23 30-Jun-2017  kamil branches: 1.23.4;
ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.22 22-Jun-2017  kamil ksh: Drop support for systems without <limits.h>
 1.21 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.20 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.19 22-Jun-2017  kamil Drop HP-UX support from ksh(1)

OK by <kre>
 1.18 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.17 03-May-2017  christos PR/52210: David H. Gutteridge: revert var pattern handling.
 1.16 30-Apr-2017  christos Use backtracking for regular patterns, but not ksh-specific ones [*?!+@](...)
which still use recursion.
 1.15 16-Oct-2011  joerg branches: 1.15.34;
Don't use non-literal format strings.
 1.14 22-Oct-2009  seanb Wrong buffer len being passed to strlcpy(). Innocuous
here but...
 1.13 25-Apr-2009  lukem Fix most of the -Wsign-compare issues.
 1.12 26-Jun-2005  christos branches: 1.12.28;
warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.11 19-Apr-2005  rillig Fixed wrong use of the <ctype.h> functions by adding an explicit conversion
to unsigned char. Approved by christos.
 1.10 11-Feb-2005  simonb White space nit- don't put a space before/after increment/decrement
operators.
 1.9 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.8 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.7 20-Jan-2003  simonb The Double-Semi-Colon Police.
 1.6 25-Sep-2002  provos change complete-list to first complete and then print a list,
also complete after '=' (dd), and ':' (ssh) and ` (backtick)
improvements from camield@openbsd.org. approved by perry and thorpej.
 1.5 04-Feb-2001  christos remove duplicate declarations, and fix nested externs.
 1.4 20-Oct-1999  hubertf branches: 1.4.6;
resolve conflicts
 1.3 09-Oct-1998  erh branches: 1.3.4;
getwd() -> getcwd(,MAXPATHLEN).
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.3.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.4.6.1 26-Feb-2002  he Pull up revision 1.5 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.12.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.15.34.2 11-May-2017  pgoyette Sync with HEAD
 1.15.34.1 02-May-2017  pgoyette Sync with HEAD - tag prg-localcount2-base1
 1.23.4.1 21-May-2018  pgoyette Sync with HEAD
 1.24.2.3 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.24.2.2 21-Apr-2020  martin Sync with HEAD
 1.24.2.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.25.10.1 02-Aug-2025  perseant Sync with HEAD
 1.2 10-Oct-1996  jtc Removed missing.c beacuse NetBSD is not missing any of the functions
that it provides.
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.3 19-Oct-2008  apb branches: 1.3.62;
In shell scripts invoked during a build, and in crunchgen, use ${AWK}
instead of plain "awk". The Makefiles that invoke these scripts
or programs will pass AWK=${HOST_AWK:Q}.
 1.2 05-Jan-2004  jmmv Homogenize usage messages: make the 'usage' word all lowercase, as this seems
to be the most common practice in our tree.
 1.1 20-Oct-1999  hubertf branches: 1.1.1;
Initial revision
 1.1.1.1 20-Oct-1999  hubertf branches: 1.1.1.1.4;
Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.62.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.3.62.1 21-Apr-2020  martin Sync with HEAD
 1.2 10-Oct-1996  jtc options.h is no longer used
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.14 31-Oct-2022  andvar fix various typos in comments and one output message.
 1.13 30-Jun-2017  kamil branches: 1.13.6;
ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.12 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.11 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.10 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.9 22-Jun-2017  kamil Remove ancient cygwin support in ksh(1)

OK by <kre>
 1.8 25-Apr-2009  lukem Fix most of the -Wsign-compare issues.
 1.7 26-Jun-2005  christos branches: 1.7.28;
warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.6 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.5 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.4 20-Oct-1999  hubertf resolve conflicts
 1.3 20-Oct-1997  lukem branches: 1.3.6;
remove $Log$ entries
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.3.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.13.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.13.6.1 21-Apr-2020  martin Sync with HEAD
 1.13 03-Jun-2018  kamil branches: 1.13.2;
ksh: Remove symbol clash with libc

Rename local function twalk() to ksh_twak().
This is needed for installing interceptors in sanitizers.

Sponsored by <The NetBSD Foundation>
 1.12 24-Jan-2018  kamil branches: 1.12.2;
ksh: Rename a local function tsearch to mytsearch

This removes a clash with well-known libc function tsearch(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by <The NetBSD Foundation>
 1.11 24-Jan-2018  kamil ksh: Rename a local function tdelete to mytdelete

This removes a clash with well-known libc function tdelete(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by <The NetBSD Foundation>
 1.10 01-Jul-2017  joerg Kill enough K&R cruft to build with clang again.
 1.9 30-Jun-2017  kamil ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.8 30-Jun-2017  kamil ksh: Drop old hack fo SunOS 4.1.x (1990-1994)
 1.7 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.6 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.5 25-Sep-2002  provos change complete-list to first complete and then print a list,
also complete after '=' (dd), and ':' (ssh) and ` (backtick)
improvements from camield@openbsd.org. approved by perry and thorpej.
 1.4 20-Oct-1999  hubertf resolve conflicts
 1.3 26-Jul-1998  mycroft branches: 1.3.4;
Remove silly prototype.
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.3 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.2 18-Dec-1996  jtc import pdksh 5.2.12
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.3.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.2.1 25-Jun-2018  pgoyette Sync with HEAD
 1.13.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.13.2.1 21-Apr-2020  martin Sync with HEAD
 1.35 30-Jun-2017  kamil branches: 1.35.6;
ksh: Drop old hack for FreeBSD 1.1.5 and CLK_TCK
 1.34 30-Jun-2017  kamil ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.33 30-Jun-2017  kamil ksh: Eliminate dead MEM_DEBUG sections, there is missing code for it

MEM_DEBUG used to contain malloc(3) debugging facilities.
 1.32 30-Jun-2017  kamil ksh: Drop support for OSes without POSIX sigaction(2)
 1.31 30-Jun-2017  kamil ksh: Assume ANSI C prototypes
 1.30 30-Jun-2017  kamil ksh: Drop support for systems without functional waitpid(2)
 1.29 23-Jun-2017  kamil ksh: Replace homegrown int_least32_t with the C99 version
 1.28 23-Jun-2017  kamil ksh: Use ANSI C varargs, drop support for older version <varargs.h>
 1.27 23-Jun-2017  kamil ksh: Remove support for NeXT Operating System
 1.26 22-Jun-2017  kamil ksh: Drop support for systems without dup2(2)
 1.25 22-Jun-2017  kamil ksh: Drop support for ISC UNIX
 1.24 22-Jun-2017  kamil ksh: Drop support for systems without offsetof(3)
 1.23 22-Jun-2017  kamil ksh: Drop support for systems without <limits.h>
 1.22 22-Jun-2017  kamil ksh: Drop support for systems without <fcntl.h>
 1.21 22-Jun-2017  kamil ksh: Drop support for systems without memmove(3) and stop using bcopy(3)
 1.20 22-Jun-2017  kamil ksh: Drop support for systems without memset(3)
 1.19 22-Jun-2017  kamil ksh: Drop usage of SVID header <memory.h>, it's legacy standard
 1.18 22-Jun-2017  kamil ksh: Drop support for systems without strcasecmp(3) and strncasecmp(3)
 1.17 22-Jun-2017  kamil ksh: Drop support for systems without strstr(3)
 1.16 22-Jun-2017  kamil ksh: Drop support for systems without <string.h>
 1.15 22-Jun-2017  kamil ksh: Drop support for systems without <stddef.h>

No functional change.
 1.14 22-Jun-2017  kamil ksh: Drop support for systems without <stdlib.h>

No functional change.
 1.13 22-Jun-2017  kamil ksh: Drop support for systems without <unistd.h>

This code wouldn't work for them anyway.

No functional change.
 1.12 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.11 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.10 22-Jun-2017  kamil Remove code for AIX, including hack for 3.2.5 (from 1997) - from ksh(1)

OK by <kre>
 1.9 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.8 22-Jun-2017  kamil Remove ancient cygwin support in ksh(1)

OK by <kre>
 1.7 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.6 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.5 11-Jul-2002  wiz 'environment', not 'enviroment'
 1.4 21-Jan-2000  mycroft Nuke `extern int errno;' in code we compile with -Wstrict-prototypes. We get
the correct definition from errno.h.
 1.3 20-Oct-1999  hubertf resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.4; 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.3 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.2.4.1 23-Jan-2000  he Pull up revision 1.4 (requested by mycroft):
Always do the errno indirection hack, so that non-threaded
libraries get the right errno value when linked with -lpthread.
This means "always include <errno.h> and never declare errno
yourself".
 1.35.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.35.6.1 21-Apr-2020  martin Sync with HEAD
 1.16 05-Feb-2024  andvar s/formated/formatted/ in comment and distrib sets descriptions.
 1.15 06-Nov-2021  msaitoh s/writting/writing/
 1.14 16-Sep-2021  christos It is either teaching gcc about aaah or adding FALLTHROUGH.
 1.13 30-Jun-2017  kamil branches: 1.13.6;
ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.12 30-Jun-2017  kamil ksh: Assume ANSI C prototypes
 1.11 23-Jun-2017  kamil ksh: Use ANSI C varargs, drop support for older version <varargs.h>
 1.10 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.9 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.8 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.7 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.6 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.5 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.4 02-Nov-2000  christos PR/11361:Matthias Buelow: Apply patch1 from pdksh site.
- set -x dumps core (shf.c);
- output of "jobs" command is filled with ^A characters (jobs.c);
- "typeset -r foo=bar" fails saying foo is readonly (var.c).
 1.3 20-Oct-1999  hubertf branches: 1.3.6;
resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.6.1 26-Feb-2002  he Pull up revision 1.4 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.13.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.13.6.1 21-Apr-2020  martin Sync with HEAD
 1.3 20-Oct-1999  hubertf branches: 1.3.106;
resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.106.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.3.106.1 21-Apr-2020  martin Sync with HEAD
 1.8 30-Jun-2017  kamil ksh: Drop support for OSes without POSIX sigaction(2)
 1.7 23-Jun-2017  kamil ksh: Drop the latest ifdef for BSD4.1 and eliminate dead code around it
 1.6 22-Jun-2017  kamil ksh: Drop fallback for BSD4.2 signal routines
 1.5 22-Jun-2017  kamil ksh: Remove fallback to BSD4.1 signal routines
 1.4 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.3 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.4 30-Jun-2017  kamil ksh: Drop support for OSes without POSIX sigaction(2)
 1.3 25-May-2002  wiz __STDC__ is always defined on NetBSD.
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2 12-Jan-1997  tls branches: 1.2.112;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.112.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.2.112.1 21-Apr-2020  martin Sync with HEAD
 1.13 23-Feb-2021  christos PR/56007: Greg A. Woods: ksh unable to execute ERR traps
(probably since 2016/03/17 - i.e. 8.x and 9.x)
 1.12 17-Mar-2016  christos branches: 1.12.8; 1.12.16; 1.12.18;
s/sed/${SED}/
 1.11 17-Mar-2016  christos put back the complex sed/awk since the code can't handle unsorted or repeated
entries (Rin Okuyama)
 1.10 16-Mar-2016  christos We don't need all this magic to build the signals lists. Do the work at
compile time.
 1.9 23-Jan-2011  hauke The Solaris 7 "/usr/{,xpg4/}bin/sort"s expect whitespace between the "-k"
option and its argument.
 1.8 25-Oct-2008  apb branches: 1.8.14;
In shell scripts run during the build, add a SED variable, defaulting
to "sed". SED=${TOOL_SED:Q} should be passed in the environment to
override this.
 1.7 19-Oct-2008  apb In shell scripts invoked during a build, and in crunchgen, use ${AWK}
instead of plain "awk". The Makefiles that invoke these scripts
or programs will pass AWK=${HOST_AWK:Q}.
 1.6 14-Nov-2006  christos fix the sort order too.
 1.5 14-Nov-2006  christos Fix signal list generation, from Jukka Salmi
 1.4 16-Oct-2006  christos use c99 initializers
 1.3 27-Jun-2006  christos PR/33834: Bucky Katz: Crossbuild on FC5:sort doesn't handle '+' field
specifications
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.8.14.1 08-Feb-2011  bouyer Sync with HEAD
 1.12.18.1 23-Feb-2021  martin Pull up following revision(s) (requested by christos in ticket #1212):

bin/ksh/siglist.sh: revision 1.13

PR/56007: Greg A. Woods: ksh unable to execute ERR traps
(probably since 2016/03/17 - i.e. 8.x and 9.x)
 1.12.16.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.12.16.1 21-Apr-2020  martin Sync with HEAD
 1.12.8.1 23-Feb-2021  martin Pull up following revision(s) (requested by christos in ticket #1658):

bin/ksh/siglist.sh: revision 1.13

PR/56007: Greg A. Woods: ksh unable to execute ERR traps
(probably since 2016/03/17 - i.e. 8.x and 9.x)
 1.11 08-May-2018  kamil branches: 1.11.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.10 30-Jun-2017  kamil branches: 1.10.4;
ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.9 16-Oct-2006  christos use c99 initializers
 1.8 22-Mar-2006  christos Change previous to assert that the index is within bounds only when the
index actually used.
 1.7 18-Mar-2006  christos Coverity CID 1484: Static buffer overrun.
 1.6 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.5 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.4 20-Oct-1999  hubertf resolve conflicts
 1.3 09-Oct-1998  erh branches: 1.3.4;
Initialize the correct fields when creating an empty command. Fixes bug where a function with no body ( e.g. "testfun () ;" ) would cause ksh to segfault when it was called.
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.5 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.4 18-Dec-1996  jtc import pdksh 5.2.12
 1.1.1.3 09-Oct-1996  jtc import pdksh 5.2.11
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.3.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.10.4.1 21-May-2018  pgoyette Sync with HEAD
 1.11.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.11.2.1 21-Apr-2020  martin Sync with HEAD
 1.8 03-Jun-2018  kamil branches: 1.8.2;
ksh: Remove symbol clash with libc

Rename local function twalk() to ksh_twak().
This is needed for installing interceptors in sanitizers.

Sponsored by <The NetBSD Foundation>
 1.7 08-May-2018  kamil Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.6 24-Jan-2018  kamil branches: 1.6.2;
ksh: Rename a local function tsearch to mytsearch

This removes a clash with well-known libc function tsearch(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by <The NetBSD Foundation>
 1.5 24-Jan-2018  kamil ksh: Rename a local function tdelete to mytdelete

This removes a clash with well-known libc function tdelete(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by <The NetBSD Foundation>
 1.4 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.3 19-Aug-1998  thorpej Add some braces to make egcs happy.
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.6.2.2 25-Jun-2018  pgoyette Sync with HEAD
 1.6.2.1 21-May-2018  pgoyette Sync with HEAD
 1.8.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.8.2.1 21-Apr-2020  martin Sync with HEAD
 1.4 03-Jun-2018  kamil branches: 1.4.2;
ksh: Remove symbol clash with libc

Rename local function twalk() to ksh_twak().
This is needed for installing interceptors in sanitizers.

Sponsored by <The NetBSD Foundation>
 1.3 20-Oct-1999  hubertf branches: 1.3.104;
resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.3 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.2 18-Dec-1996  jtc import pdksh 5.2.12
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.104.1 25-Jun-2018  pgoyette Sync with HEAD
 1.4.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.4.2.1 21-Apr-2020  martin Sync with HEAD
 1.14 08-May-2018  kamil branches: 1.14.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.13 30-Jun-2017  kamil branches: 1.13.4;
ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.12 23-Jun-2017  kamil ksh: Drop support for UNIX V7-style signal routines
 1.11 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.10 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.9 22-Jun-2017  kamil Remove code for AIX, including hack for 3.2.5 (from 1997) - from ksh(1)

OK by <kre>
 1.8 16-Oct-2006  christos use c99 initializers
 1.7 13-May-2006  christos Coverity CID 3367, 3368: Avoid NULL deref.
 1.6 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.5 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.4 16-Sep-2001  wiz Spell 'occurred' with two 'r's.
 1.3 20-Oct-1999  hubertf branches: 1.3.6;
resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.3.6.1 26-Feb-2002  he Pull up revision 1.4 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.13.4.1 21-May-2018  pgoyette Sync with HEAD
 1.14.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.14.2.1 21-Apr-2020  martin Sync with HEAD
 1.10 16-Sep-2021  christos It is either teaching gcc about aaah or adding FALLTHROUGH.
 1.9 08-May-2018  kamil branches: 1.9.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.8 30-Jun-2017  kamil branches: 1.8.4;
ksh: Assume ANSI C prototypes
 1.7 23-Jun-2017  kamil ksh: Use ANSI C varargs, drop support for older version <varargs.h>
 1.6 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.5 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.4 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.3 20-Oct-1999  hubertf resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.8.4.1 21-May-2018  pgoyette Sync with HEAD
 1.9.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.9.2.1 21-Apr-2020  martin Sync with HEAD
 1.7 22-Jun-2017  kamil branches: 1.7.6;
Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.6 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.5 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.4 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.3 20-Oct-1999  hubertf resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.7.6.1 21-Apr-2020  martin Sync with HEAD
 1.10 24-Jul-2021  andvar Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
 1.9 30-Jun-2017  kamil branches: 1.9.6;
ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.8 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.7 23-Jun-2017  kamil ksh: Remove remnant hack for SCO UNIX in tty code
 1.6 23-Jun-2017  kamil ksh: Remove support for NeXT Operating System
 1.5 23-Jun-2017  kamil ksh: Drop BSD4.3 temporary hack in tty code
 1.4 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.3 07-Apr-1998  fair change some /dev/tty to paths.h _PATH_TTY
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.9.6.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.9.6.1 21-Apr-2020  martin Sync with HEAD
 1.2 12-Jan-1997  tls branches: 1.2.112;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.2 18-Dec-1996  jtc import pdksh 5.2.12
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.112.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.2.112.1 21-Apr-2020  martin Sync with HEAD
 1.26 08-Sep-2024  rillig s/effect/affect/ in a few places
 1.25 02-Jun-2023  andvar branches: 1.25.2;
follow the steps of Andrew Doran (ad) commit and fix more s/loose/lose/ typos.
also s/beyound/beyond/ and few others along the way, mainly in comments.
 1.24 08-May-2018  kamil branches: 1.24.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.23 24-Jan-2018  kamil branches: 1.23.2;
ksh: Rename a local function tsearch to mytsearch

This removes a clash with well-known libc function tsearch(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by <The NetBSD Foundation>
 1.22 24-Jan-2018  kamil ksh: Rename a local function tdelete to mytdelete

This removes a clash with well-known libc function tdelete(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by <The NetBSD Foundation>
 1.21 01-Jul-2017  joerg Kill enough K&R cruft to build with clang again.
 1.20 30-Jun-2017  kamil ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.19 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.18 30-Jun-2017  kamil ksh: Drop support for systems with broken <sys/time.h> / <time.h>
 1.17 16-Oct-2011  joerg Don't use non-literal format strings.
 1.16 16-Oct-2011  reed Typo in comment fix from Snader_LB via IRC.
 1.15 02-Aug-2009  dsl Support 0xnn for hexadecimal constants - as well as 16#nn.
While here, make '-' only valid once, and at the start of the number.
Fixes PR/40512
 1.14 29-Mar-2006  christos branches: 1.14.26; 1.14.32;
Don't leak memory if RJUST|LJUST is specified. This might fix a whole bunch
of Coverity issues, but we'll wait until the next run :-)
 1.13 19-Mar-2006  christos Coverity CID 1606: Plug memory leak.
 1.12 26-Jun-2005  christos warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.11 23-May-2005  rillig Fixed wrong use of the <ctype.h> functions by adding (unsigned char) casts.
 1.10 28-Oct-2004  dsl Add (unsigned char) casts to tolower/toupper and iscntrl calls.
Fixes PR 27593
 1.9 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.8 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.7 02-Nov-2000  christos PR/11361:Matthias Buelow: Apply patch1 from pdksh site.
- set -x dumps core (shf.c);
- output of "jobs" command is filled with ^A characters (jobs.c);
- "typeset -r foo=bar" fails saying foo is readonly (var.c).
 1.6 20-Oct-1999  hubertf branches: 1.6.6;
resolve conflicts
 1.5 04-Nov-1998  christos branches: 1.5.4;
char->unsigned char casts for is*()
 1.4 19-Aug-1998  thorpej Add some braces to make egcs happy.
 1.3 20-Jul-1997  christos Fix compiler warnings
Add WARNS=1
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.3 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.5.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.6.1 26-Feb-2002  he Pull up revision 1.7 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.14.32.1 21-Apr-2010  matt sync to netbsd-5
 1.14.26.1 26-Sep-2009  snj Pull up following revision(s) (requested by tron in ticket #889):
bin/ksh/var.c: revision 1.15
Support 0xnn for hexadecimal constants - as well as 16#nn.
While here, make '-' only valid once, and at the start of the number.
Fixes PR/40512
 1.23.2.1 21-May-2018  pgoyette Sync with HEAD
 1.24.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.24.2.1 21-Apr-2020  martin Sync with HEAD
 1.25.2.1 02-Aug-2025  perseant Sync with HEAD
 1.5 26-Jun-2005  christos branches: 1.5.86;
warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.4 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.3 20-Oct-1999  hubertf resolve conflicts
 1.2 12-Jan-1997  tls branches: 1.2.6;
RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.5 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.4 18-Dec-1996  jtc import pdksh 5.2.12
 1.1.1.3 09-Oct-1996  jtc import pdksh 5.2.11
 1.1.1.2 09-Oct-1996  jtc import pdksh 5.2.9
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.2.6.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.86.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.5.86.1 21-Apr-2020  martin Sync with HEAD
 1.21 16-Sep-2021  christos It is either teaching gcc about aaah or adding FALLTHROUGH.
 1.20 08-May-2018  kamil branches: 1.20.2;
Stop using the register keyword in ksh(1)

ksh also does some strange things with it, like put it in argument lists.

No functional change intended.

PR bin/53237 ksh: remove register keyword by Nia Alarie
 1.19 24-Jan-2018  kamil branches: 1.19.2;
ksh: Rename a local function tsearch to mytsearch

This removes a clash with well-known libc function tsearch(3) from POSIX.

This allows to build ksh against MSan.

The new name might not be perfect, but long term ksh should be switched to
the libc version.

Sponsored by <The NetBSD Foundation>
 1.18 30-Jun-2017  kamil ksh: Upgrade to C99 <stdbool.h>

This shell already used C99 functions.
 1.17 30-Jun-2017  kamil ksh: Drop support for systems without <sys/stat.h>

In future the order of includes will be normalized with KNF.

No functional change intended.
 1.16 22-Jun-2017  kamil Reapply removal of code from 90ties for OS/2 Cygwin AIX HPUX SCOUnix

Added missing #endif terminator in emacs.c
 1.15 22-Jun-2017  kamil Temporarily revert previous.

emacs.* gets wrong code in generation
 1.14 22-Jun-2017  kamil Remove os2 support in ksh(1)

OK by <kre>
 1.13 03-Feb-2016  christos PR/50747: David Binderman: check bounds before dereference.
While here add some continues before semicolons.
 1.12 22-Jun-2011  mrg add a missing part from rev 1.10 and s/newline/newlinex/. found by GCC 4.5.3.
 1.11 25-Apr-2009  lukem Fix most of the -Wsign-compare issues.
 1.10 26-Jun-2005  christos branches: 1.10.28;
warns=3
- remove param names from function decls
- sprinkle const
- rename shadowed variables
- XXX: there is a lot of fishy __UNCONST going on.
 1.9 28-Oct-2004  dsl Add (unsigned char) casts to tolower/toupper and iscntrl calls.
Fixes PR 27593
 1.8 07-Jul-2004  mycroft Cleanup of ksh memory handling from OpenBSD, via Stefan Krueger in PR 24962.
Should also fix:
PR 8153
PR 13301
PR 15256
PR 25084
 1.7 23-Jun-2003  agc Add NetBSD RCS Ids.
 1.6 20-Aug-2001  wiz "wierd" is weird.
 1.5 02-Nov-1999  jdolecek branches: 1.5.6;
Implement (somewhat enhanced) idea stealed from bash:
when completing the filename (either in vi mode with vi-tabcomplete on,
or in emacs mode after double esc), escape any shell special characters
and chars from $IFS with backslash - very handy especially when
dealing with filenames containing spaces

The patch has been sent to maintainer, but I haven't got any reply yet even
after about a month :(
 1.4 20-Oct-1999  hubertf resolve conflicts
 1.3 04-Nov-1998  christos branches: 1.3.4;
char->unsigned char casts for is*()
 1.2 12-Jan-1997  tls RCS ID Police
 1.1 21-Sep-1996  jtc branches: 1.1.1;
Initial revision
 1.1.1.3 20-Oct-1999  hubertf Import pdksh V5.2.14.
Includes lots of bugfixes.
 1.1.1.2 18-Dec-1996  jtc import pdksh 5.2.12
 1.1.1.1 21-Sep-1996  jtc import pdksh 5.2.8
 1.3.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.5.6.1 26-Feb-2002  he Pull up revision 1.6 (requested by dogcow):
Synchronize with current development version:
o fix problem with ``set -x'' causing a core dump; fixes PR#11361
o fix problem with ``set -e'' causing early exit; fixes PR#11542
o fix various misspellings and nested extern declarations
 1.10.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.19.2.1 21-May-2018  pgoyette Sync with HEAD
 1.20.2.2 21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.20.2.1 21-Apr-2020  martin Sync with HEAD

RSS XML Feed