Commit Graph

266 Commits

Author SHA1 Message Date
lukem 230c41e44c adapt to ${CC_WNO_IMPLICIT_FALLTHROUGH}
Use ${CC_WNO_IMPLICIT_FALLTHROUGH} instead of
the older style more complex expressions.
2023-06-03 21:30:20 +00:00
andvar cb40c69b16 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.
2023-06-02 08:51:46 +00:00
andvar 8a36802c94 fix various typos in comments and one output message. 2022-10-31 21:22:05 +00:00
uwe 21531a4577 ksh(1): fix pasto in the description of the -l option. 2022-08-21 20:12:37 +00:00
andvar 5a58ccfbec fix various typos in comments, documentation and messages.
mainly s/paramater/parameter/ and s/reduntant/redundant/.
2022-08-07 11:06:18 +00:00
kre 8f36a40a4c 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).
2022-07-03 06:30:31 +00:00
msaitoh f81569c702 s/writting/writing/ 2021-11-06 06:40:33 +00:00
andvar 56d66eb030 "no affect" -> "no effect" in man pages and comments. 2021-10-30 21:08:58 +00:00
christos 1b2514eee4 It is either teaching gcc about aaah or adding FALLTHROUGH. 2021-09-16 19:44:01 +00:00
christos b8d28f3621 support -Z 2021-09-16 19:43:33 +00:00
andvar 7991f5a7b8 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.
2021-07-24 21:31:31 +00:00
christos c81959ef98 PR/56007: Greg A. Woods: ksh unable to execute ERR traps
(probably since 2016/03/17 - i.e. 8.x and 9.x)
2021-02-23 01:31:30 +00:00
joerg 039ca0edea Avoid arithmetics on strings. 2019-10-29 16:19:59 +00:00
mrg 21303c93e9 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-29 23:44:58 +00:00
mlelstv 6883e45b87 Fix FALLTHROUGH comments. 2019-09-26 11:01:09 +00:00
mrg 1fcf7be45f - use -Wno-error=implicit-fallthrough with GCC7. 2019-02-04 04:05:15 +00:00
sevan 1f921aefc9 Add -l to SYNOPSIS 2018-08-26 22:52:34 +00:00
kamil d6d5f49c60 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>
2018-06-12 14:13:55 +00:00
kamil b9cf72ac86 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>
2018-06-03 16:09:31 +00:00
kamil 3eb9a6b77e 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>
2018-06-03 12:18:29 +00:00
kamil 0f2b5450fb 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
2018-05-08 16:37:59 +00:00
kamil 081e832953 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>
2018-01-24 09:53:20 +00:00
kamil 6d8c9dfa44 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>
2018-01-24 09:21:20 +00:00
maya ee3bb8535b Use 0600 as the mode for histfile here too.
pointed out by John D. Baker in PR bin/52480
2018-01-17 00:29:22 +00:00
joerg da656e3d1c Kill enough K&R cruft to build with clang again. 2017-07-01 23:12:08 +00:00
kamil 6327936549 ksh: Eliminate dead function x_complete_word() 2017-06-30 05:18:36 +00:00
kamil dda96fab20 ksh: Eliminate dead code from expand.h 2017-06-30 05:14:12 +00:00
kamil 00cd1c66a2 ksh: Drop old hack for FreeBSD 1.1.5 and CLK_TCK 2017-06-30 04:44:46 +00:00
kamil dd8a75d57f ksh: Upgrade to C99 <stdbool.h>
This shell already used C99 functions.
2017-06-30 04:41:19 +00:00
kamil c2a517fe40 ksh: Eliminate dead MEM_DEBUG sections, there is missing code for it
MEM_DEBUG used to contain malloc(3) debugging facilities.
2017-06-30 04:30:26 +00:00
kamil a5a27bbf6f ksh: Drop support for OSes without POSIX sigaction(2) 2017-06-30 04:22:22 +00:00
kamil 2537c199ea ksh: Drop support for OSes that don't map /dev/fd 2017-06-30 04:11:57 +00:00
kamil 91e15fa768 ksh: Drop old hack fo SunOS 4.1.x (1990-1994) 2017-06-30 04:01:48 +00:00
kamil fac4b39487 ksh: Drop support for systems without <sys/stat.h>
In future the order of includes will be normalized with KNF.

No functional change intended.
2017-06-30 03:56:12 +00:00
kamil 1dacfa0dd2 ksh: Drop support for systems with broken <sys/time.h> / <time.h> 2017-06-30 03:43:57 +00:00
kamil e6ed5dea98 ksh: Drop support for systems without POSIX lstat(2) 2017-06-30 03:35:16 +00:00
kamil a396fc9936 ksh: Drop support for systems without POSIX <sys/wait.h> 2017-06-30 03:32:28 +00:00
kamil 3e5f067b68 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.
2017-06-30 03:23:18 +00:00
kamil 2c22621e8f ksh: Assume ANSI C prototypes 2017-06-30 02:51:14 +00:00
kamil 81c962c859 ksh: Drop support for systems without functional waitpid(2) 2017-06-30 02:38:09 +00:00
kamil 8ea5ae4cd1 ksh: Drop support for systems without POSIX signal routines 2017-06-30 02:20:47 +00:00
kamil 306d025987 ksh: Drop support for systems without implementation of EINTR
These systems weren't handled anyway.
2017-06-30 02:13:29 +00:00
kamil 51ebc97c9d ksh: Drop support for systems without handling shebang 2017-06-30 02:06:59 +00:00
kamil 5c93126131 ksh: Drop support for OSes without POSIX types
Assume available: mode_t, off_t, pid_t, uid_t, rlim_t, sigset_t.
2017-06-30 02:02:41 +00:00
kamil 9d5663e055 ksh: Drop support for systems without <sys/wait.h> 2017-06-30 01:56:34 +00:00
kamil 3e63fce1f9 ksh: Drop ksh_wait.h that reinvents <sys/wait.h> (POSIX header)
Switch jobs.c to <sys/wait.h>.

No functional change intended.
2017-06-30 01:52:34 +00:00
kamil d0aa393796 ksh: Drop support for systems without gid_t 2017-06-30 01:36:30 +00:00
kamil c6c3f8f1f5 ksh: Drop support for systems without clock_t type 2017-06-23 00:35:20 +00:00
kamil b831372d44 ksh: Replace homegrown int_least32_t with the C99 version 2017-06-23 00:29:42 +00:00
kamil 730f723665 ksh: Drop support for systems that return void for closedir(2) 2017-06-23 00:20:22 +00:00