summaryrefslogtreecommitdiffstats
path: root/bin/ksh/expr.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* When evaluating an arithmetical expression, for example inside $(()),schwarze2019-02-201-1/+6
| | | | | | | | | | | | | | | | | | | 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@
* Support 64 bit integers on 32 bit architectures.tobias2018-04-091-3/+3
| | | | | | | 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
* rename global "e" to genv to avoid accidental shadowing and aliasing.tedu2015-12-301-2/+2
| | | | ok millert nicm tb
* Move string.h include from sh.h to the files that use it.mmcc2015-10-191-1/+2
| | | | ok nicm@
* Move limits.h include from sh.h to the files that actually need it. Nommcc2015-10-191-1/+2
| | | | | | binary change. ok nicm@
* Apply style(9) to header includes.mmcc2015-10-191-2/+2
| | | | ok nicm@
* Make errorf() and bi_errorf() handle a NULL argument.millert2015-09-221-2/+2
| | | | From Michael McConville; OK nicm@
* Last of the (thing *)0 -> NULL, from Michael McConville. No binarynicm2015-09-181-4/+4
| | | | change.
* Remove unnecessary casts, from Michael McConville. No binary change.nicm2015-09-171-2/+2
|
* correct spelling of NULL from (char *)0. from Michael McConville.tedu2015-09-151-3/+3
| | | | ok md5
* fix crash when trying to apply ++ without an lvalue; ok millert@ jsg@otto2014-12-081-2/+3
|
* ctype cleanups. Repeated re-audits of this sensitive area by okan andderaadt2013-12-171-2/+2
| | | | | myself, with a variety of other people spending some time as well. Thanks.
* Don't die with SIGFPE on LONG_MIN / -1 or % -1. Instead make LONG_MIN /nicm2013-03-281-3/+9
| | | | | | -1 == LONG_MIN and % -1 == 0. ok matthew deraadt
* please sthen the 80 character pedantderaadt2009-06-011-2/+3
|
* "let --" was crashing ksh; found by phy0@rambler.ru. Various other expressionsderaadt2009-06-011-2/+2
| | | | | | involving ++ and -- also ran into this. Insufficient checks for end of parse in the tokenizer made it assume that an lvalue had been found ok millert otto
* fix lint comments, no functional changes; ok rayjaredy2006-04-101-3/+3
|
* lots of indentation cleanup, now ksh is readable like our other code.deraadt2005-03-301-70/+69
| | | | double checked to make sure no binaries change, and eyed by niallo
* Introduce POSIX hex and octal (0x... and 0...) constants in arithmeticotto2005-02-021-10/+16
| | | | | | | expressions. Work by Matthias Kilian, based on an old diff by myself. Note: MAKEDEV should be updated. Tested by many, thanks. ok millert@ deraadt@
* Fix a use-after-free, that causs core dumps if a shell is killedotto2004-12-221-3/+3
| | | | | | | running with strict malloc.conf options. Problem spotted by hshoexer@; fix by me with some help from millert@. ok millert@ hshoexer@ krw@ deraadt@
* Use stdbool.h instead of rolling our own bools.millert2004-12-221-11/+11
|
* Ansification plus some minor knf. No binary change on i386 andotto2004-12-201-40/+17
| | | | | sparc64, binary change in lex.o on macppc due to introduction of dopprompt() prototype. ok millert@
* remove GCC_FUNC_ATTR/GCC_FUNC_ATTR2 and just use __attribute__ directlymillert2004-12-181-2/+2
| | | | (we define it away in sys/cdefs.h if it is not supported).
* deregistermillert2004-12-181-2/+2
|
* Get rid of #ifdef KSH since we don't care about building a V7 style sh andmillert2004-12-181-5/+2
| | | | the #ifdef KSH code is required to make a POSIX sh. From Matthias Kilian
* Remove unused OS dependent #ifdef blocks, #defines and macro abstraction.millert2004-12-181-14/+14
| | | | First step in making the ksh code easier to read. From Matthias Kilian
* typos from Jared Yanovich;jmc2003-10-221-4/+4
| | | | ok deraadt@
* typos; from Brian Poolejmc2003-02-281-2/+2
|
* patches from pdksh 5.2.13.11millert1999-06-151-8/+17
|
* Updates from pdksh-unstable-5.2.13.7. Most notable change is:millert1999-01-191-64/+65
| | | | | trap: exit traps now executed in subshells (without explicit exit call). See the Changelog for a full list of changes.
* sync with pdksh-unstable-5.2.13.6millert1999-01-101-1/+2
|
* back outkstailey1997-06-191-5/+5
|
* (foo *)0 -> NULLkstailey1997-06-181-5/+5
|
* update to pdksh-5.2.8downsj1996-08-191-45/+103
|
* Import pdksh 5.2.7.downsj1996-08-141-0/+538