summaryrefslogtreecommitdiff
path: root/bin/ksh/eval.c
AgeCommit message (Collapse)Author
2017-08-27Remove unused copy_non_glob() in ksh.Nayden Markatchev
Report and diff by David Crosby <dave@dafyddcrosby.com> OK otto@
2017-07-04Backout previous due to a bug discovered by zhuk@ that requires some tinkeringanton
and is not an easy fix for now.
2017-07-04Add support for pattern substitution to variables in ksh using a common syntaxanton
borrowed from ksh93. Survived a ports build performed by naddy@ and encouraged by many.
2017-05-01Quiet an "implicit conversion from 'int' to 'char' changes value"Todd C. Miller
warning from clang.
2016-03-05POSIX-compliant behavior of "set -u" regarding "$*" and "$@" specialsDmitrij Czarkoff
All work done by Martijn Dekker OK millert@
2015-12-30rename global "e" to genv to avoid accidental shadowing and aliasing.Ted Unangst
ok millert nicm tb
2015-12-14Move system headers from sh.h to those files that actually need them.tb
ok mmcc@ a while ago
2015-11-12Use isdigit() instead of ksh's homebrewed alternative.mmcc
ok nicm@. Also discussed with millert@ and guenther@.
2015-10-19Remove the define NOT, replace it with '!'. No binary change.mmcc
"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@
2015-10-19Move string.h include from sh.h to the files that use it.mmcc
ok nicm@
2015-10-19Apply style(9) to header includes.mmcc
ok nicm@
2015-09-18Last of the (thing *)0 -> NULL, from Michael McConville. No binaryNicholas Marriott
change.
2015-09-17Remove unnecessary casts, from Michael McConville. No binary change.Nicholas Marriott
2015-09-15correct spelling of NULL from (char *)0. from Michael McConville.Ted Unangst
ok md5
2013-09-14Back out revision 1.38. Commands executed via `foo` or $( bar )Todd C. Miller
actually should inherit "set -e" status according to POSIX. OK jca@
2013-07-01Make $(< /nonexistent) have the same behaviour as $(cat /nonexistent)Jeremie Courreges-Anglas
wrt. errors (do not unwind and do not treat this as fatal if set -e is used). This matches what bash does. Tweak regress tests while here. ok millert@, jasper@ agrees
2013-06-19Commands executed via `foo` or $( bar ) should not inherit "set -e"Todd C. Miller
status. We can't use XERROK for this (since the command might set -e itself) so just save & restore the value of FERREXIT for the comsub() call to execute(). OK jca@
2011-10-11gc unused var; from Michael W. BombardieriOtto Moerbeek
2011-03-15fix uninitialized variable warnings (lifted from mksh).Okan Demirmen
noticed by and ok kevlo@
2010-03-24fix the cases where ${name#pat} and ${name%pat} will generate an empty wordFederico G. Schwindt
when they shouldn't. originally from mksh but modified to handle the case when the expr is quoted as noticed by halex@. input from guenther@ and halex@, millert@ ok
2009-01-29pass "xerrok" status across the execution call stack to more closelyJared Yanovich
match what both POSIX and ksh.1 already describe in regards to set -e/errexit's behavior in determining when to exit from nonzero return values. specifically, the truth values tested as operands to `&&' and `||', as well as the resulting compound expression itself, along with the truth value resulting from a negated command (i.e. a pipeline prefixed `!'), should not make the shell exit when -e is in effect. issue reported by matthieu. testing matthieu, naddy. ok miod (earlier version), otto. man page ok jmc.
2007-08-02backout last change; iff is right.Federico G. Schwindt
prompted by deraadt@
2007-08-02while i'm here: iff -> ifFederico G. Schwindt
2007-08-02fix memory leaks and one potential null deref found by coverity. from netbsd.Federico G. Schwindt
millert@ ok
2006-04-10fix lint comments, no functional changes; ok rayJared Yanovich
2006-03-17Simplify savefd() by removing the "noclose" flag and make nocloseTodd C. Miller
behavior the default. Almost all uses of savefd() are followed by an implicit or explicit close. OK otto@
2005-12-11fix a few name clashes with libc; found by lint. ok deraadt@Otto Moerbeek
2005-03-30lots of indentation cleanup, now ksh is readable like our other code.Theo de Raadt
double checked to make sure no binaries change, and eyed by niallo
2005-02-25knfTheo de Raadt
2005-02-02Introduce POSIX hex and octal (0x... and 0...) constants in arithmeticOtto Moerbeek
expressions. Work by Matthias Kilian, based on an old diff by myself. Note: MAKEDEV should be updated. Tested by many, thanks. ok millert@ deraadt@
2004-12-22Fix previous commit here, I add the case statement to the wrong switch.Todd C. Miller
2004-12-22Make 'echo ${a[@]:?foo}' produce an error, not a core dump.Todd C. Miller
Bug noticed by otto@.
2004-12-22Use stdbool.h instead of rolling our own bools.Todd C. Miller
2004-12-20Ansification plus some minor knf. No binary change on i386 andOtto Moerbeek
sparc64, binary change in lex.o on macppc due to introduction of dopprompt() prototype. ok millert@
2004-12-18deregisterTodd C. Miller
2004-12-18Remove unused OS dependent #ifdef blocks, #defines and macro abstraction.Todd C. Miller
First step in making the ksh code easier to read. From Matthias Kilian
2004-12-13Restore sp before calling snptreef() so the error message containsTodd C. Miller
the actual expression that caused the error. OK otto@
2004-12-09partially backout prevous commit, it breaks eval of ${a[@]}Otto Moerbeek
2004-12-08Fix core dumps for ${@:?word} and ${foo[@]?bar}. With help fromTodd C. Miller
and OK otto@. Closes PR 4023.
2004-11-25Change the behavior of IFS word-splitting: split wordsJared Yanovich
when the current character is IFS space and the last character was a word character or it was non-white IFS space and the current character is non-white IFS space. This deviates from the previous behavior because the latter splits words when the last character is any IFS space and the current is non-white IFS, resulting in more fields most of the time. This new behavior follows what the man page describes; i.e., that a field is delimited by one or more IFS whitespace characters followed by zero or one non-white IFS characters. Requires addition of a new substitution expansion state to handle the special case of empty fields at the beginning. testing by naddy ok jmc, millert, otto, deraadt
2003-11-10If "from fd" == "to fd" don't call dup2() or close "from fd".Todd C. Miller
2003-04-16string cleaning. ok tedu@Thierry Deval
2003-03-10spelling fixesDavid Krause
ok millert@
2003-02-28typos; from Brian PooleJason McIntyre
2002-06-09knfTodd T. Fries
1999-06-15patches from pdksh 5.2.13.11Todd C. Miller
1999-01-10sync with pdksh-unstable-5.2.13.6Todd C. Miller
1999-01-08bug fixes from pdksh-unstable-5.2.13.5; some of which we already had.Todd C. Miller
1998-10-29Bug fixes from pdksh-unstable-5.2.13.4, including "official" versions ofTodd C. Miller
some that we had already fixed locally. o typeset -f FUNC doesn't print follows command (and expression) substitutions. o when re-allocating memory, too much may be copied from old memory. o set -o printed some options sans names. o emacs mode: <esc>. in very fist command causes core dump. o pdksh dumps core after a cd command. o typeset -i reports on array elements that have no value (at&t ksh reports on array base name - no index). o ulimit -ctn unlimittttted kills shell (resource exceeded). o ". /dev/null" says access denied. o flag field in aliases incorrectly changed (all flags set instead of clearing ISSET) in exec.c(flushcom). o ${#array[*]} prints largest index instead of number of (set) elements in an array (ksh88 does the former). o sys_siglist[] doesn't always have NSIG non-null entries...
1998-06-25pdksh-5.2.13 + local changesTodd C. Miller