summaryrefslogtreecommitdiffstats
path: root/bin/ksh/sh.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add support for set -o pipefailjca2020-07-071-1/+2
| | | | | | | | | | | | | | | | With the pipefail option set, the exit status of a pipeline is 0 if all commands succeed, or the return status of the rightmost command that fails. This can help stronger error checking, but is not a silver bullet. For example, commands will exhibit a non-zero exit status if they're killed by a SIGPIPE when writing to a pipe. Yet pipefail was considered useful enough to be included in the next POSIX standard. This implementation remembers the value of the pipefail option when a pipeline is started, as described as option 1) in https://www.austingroupbugs.net/view.php?id=789#c4102 Requested by ajacoutot@, ok millert@
* When evaluating an arithmetical expression, for example inside $(()),schwarze2019-02-201-1/+2
| | | | | | | | | | | | | | | | | | | never do substitution (neither parameter, nor command, nor arithmetic, nor tilde substitution) on the values of any variables encountered inside the expression, but do recursively perform arithmetical evaluation of subexpressions as required. This makes behaviour more consistent, without hindering any behaviour promised in the manual page. A quirk originally reported by Andy Chu <andychup at gmail dot com> was that in the past, when encountering an array index, the shell would not only do evaluation, but also substitution on the array index, even though substitution would not be done on the expression in general. tobias@ contributed to initial efforts of understanding the quirk. patch tested in a bulk build by naddy@ "please commit" deraadt@
* Fix the case where the recursion detection isn't reset when the command ismartijn2018-11-201-1/+2
| | | | | | | interrupted. Lots of back and forth with anton@ OK jca@, tb@, anton@
* remove the alias type='whence -v' and replace it withbenno2018-05-181-1/+2
| | | | | | | | | a buildin command, that just calls into c_whence(). This makes type look like the buildin in other shells and makes things like system("'type' 'git'"); work. With lots of suggestions and feedback from anton@, kn@ and jca@. ok kn@ jca@
* Support 64 bit integers on 32 bit architectures.tobias2018-04-091-7/+7
| | | | | | | No binary change on amd64 and there should be no differences on any other 64 bit architecture either (because long = int64_t). ok cheloha, tb
* Introduce internal_warningf() and mark internal_errorf() as noreturnjca2018-01-161-3/+5
| | | | | This helps tools like scan-build, and follows the example of warningf() and errorf(). ok anton@
* Stop pretending we support building ksh without EDIT/HISTORY supportjca2018-01-151-9/+3
| | | | ok anton@
* unifdef BRACE_EXPAND; ok jca@anton2018-01-141-3/+1
|
* Bring back the sign compare changes, this time with a fix from otto@millert2018-01-061-1/+2
| | | | that fixes the issues seen on hppa. OK deraadt@ otto@
* unifdef JOBS supportjca2018-01-051-3/+1
| | | | | Prompted by a mail from Klemens Nanni, who also had the same diff. ok deraadt@ millert@
* Add -Wshadow to Makefile and fix the resulting warnings. Many ofmillert2017-12-271-2/+2
| | | | | | | the warnings are due to the use of globals with generic names, specifically "options" and "path". I've renamed "options" to "sh_options" since it holds the shell options and "path" to "search_path". OK jca@ tb@
* Delete the deprecated emacs-usemeta option.jca2017-10-191-2/+1
| | | | ok tb@ anton@
* Use PATH_MAX instead of a local definejca2017-09-031-2/+2
| | | | okk deraadt@ millert@ anton@
* Implement HISTCONTROL ignoredups & ignorespace featuresjca2017-08-301-1/+2
| | | | | | | | ignoredups: don't save the current line if it is identical to the last history line. ignorespace: don't save the current line if it starts with a space ok anton@ millert@
* Stop exposing the emacs-usemeta option, and warn when trying to set it.jca2017-08-301-2/+2
| | | | | Unused since 2012, to be removed after 6.2. Input from anton@, ok anton@ millert@
* Backout previous due to a bug discovered by zhuk@ that requires some tinkeringanton2017-07-041-3/+2
| | | | and is not an easy fix for now.
* Add support for pattern substitution to variables in ksh using a common syntaxanton2017-07-041-2/+3
| | | | | | borrowed from ksh93. Survived a ports build performed by naddy@ and encouraged by many.
* Increase the input line buffer to 4096 bytes.martijn2017-06-291-2/+2
| | | | | Sounds good to deraadt@ OK anton@
* Add KSH_IGNORE_RDONLY flag and use it in var.c instead of the 0x4millert2016-09-081-3/+4
| | | | magic number.
* remove CSRG BSD-licensed mknod builtin code which was previously used toderaadt2016-03-041-4/+1
| | | | | | | accelerate install/upgrade time MAKEDEV runs. That allows ramdisk ksh to be pledged, without needing "dpath". We'll solve the performance issues a different way (soon). ok otto espie natano tb tobiasu rpe
* rename global "e" to genv to avoid accidental shadowing and aliasing.tedu2015-12-301-3/+3
| | | | ok millert nicm tb
* Move system headers from sh.h to those files that actually need them.tb2015-12-141-11/+2
| | | | ok mmcc@ a while ago
* remove unused prototypetb2015-11-201-2/+1
| | | | ok mmcc@
* Use isdigit() instead of ksh's homebrewed alternative.mmcc2015-11-121-4/+4
| | | | ok nicm@. Also discussed with millert@ and guenther@.
* Make it clearer that warningf()'s first argument determines whether themmcc2015-11-071-2/+2
| | | | | | lineno is printed. ok nicm@
* Add uses of areallocarray(). mksh and Bitrig ksh already have similarmmcc2015-11-011-2/+2
| | | | | | functions. With help from Theo Buehler. ok nicm@
* Remove two comments listing functionless files. Trivial, no functionalmmcc2015-10-231-3/+1
| | | | change.
* proto.h contains many function prototypes. It's apparently separate frommmcc2015-10-231-2/+237
| | | | | | | sh.h because the pdksh devs used a prototype generator (last run in 1992). Merging it into sh.h makes things clearer. ok nicm@
* Final removal of EXTERN.mmcc2015-10-221-24/+8
| | | | ok nicm@
* Penultimate commit to remove EXTERN.mmcc2015-10-211-12/+12
| | | | ok nicm@
* Remove the define NOT, replace it with '!'. No binary change.mmcc2015-10-191-2/+1
| | | | | | | | "The ^ is used in regular expressions and many versions of fnmatch(3) accept both ! and ^. However, we are never going to accept ^ instead of ! so I think this makes sense" -millert@ "go for it" -nicm@
* A little style(9) for sh.h includesmmcc2015-10-191-2/+3
| | | | ok nicm@
* Move stddef.h include from sh.h to the file that uses it.mmcc2015-10-191-2/+1
| | | | ok nicm@
* Move string.h include from sh.h to the files that use it.mmcc2015-10-191-2/+1
| | | | ok nicm@
* Move limits.h include from sh.h to the files that actually need it. Nommcc2015-10-191-2/+1
| | | | | | binary change. ok nicm@
* More removal of EXTERN.mmcc2015-10-191-5/+6
| | | | ok nicm@
* Move more EXTERN-defined globals from sh.h.mmcc2015-10-181-9/+9
| | | | ok nicm@
* Drop two useless defines.mmcc2015-10-171-4/+1
| | | | ok nicm@
* Move a system header include from the global header (sh.h) into themmcc2015-10-171-3/+1
| | | | | | files that need it. No binary change. "This looks fine" -nicm@
* Replace Tflag typedef with just int; ok tedunicm2015-09-141-5/+2
|
* Apply the ancient art of tedu to ksh_limval.h. ok guenthernicm2015-09-141-1/+3
|
* Replace newline and space defines by "\n" and " " directly, from Michaelnicm2015-09-101-3/+1
| | | | McConville. ok millert
* Remove INT32 define and just use int, from Martijn van Duren and Michaelnicm2015-09-101-9/+3
| | | | McConville. ok deraadt
* Remove artificial limit on the max array index.millert2013-12-181-2/+1
| | | | | Adapted from a bitrig commit from Martin Natano. OK zhuk@
* remove trailing whitespaces; use tabs instead of spaces where appropriate;sobrado2013-11-281-2/+2
| | | | no binary changes.
* fake a sigwinch after each job, so if the terminal changes size,tedu2012-09-101-1/+2
| | | | we'll notice and update
* Crank max array size in ksh to 10K-1, since 2047 is too restrictive.deraadt2010-01-041-2/+2
| | | | | Please keep in mind that ksh accesses are not O(1) in any sense. Needed by todd, ok otto, guenther
* remove unused variables and functionsderaadt2005-12-111-2/+1
|
* Bump max array size. Needed for upcoming MAKEDEV speedup. ok deraadt@otto2005-10-041-2/+2
|
* spacingderaadt2005-03-281-7/+7
|