summaryrefslogtreecommitdiffstats
path: root/bin/ksh (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Keep the time pipeline's stack in tactkn2018-04-241-4/+8
| | | | | | | | | | Revision 1.28 (2008) fixed stack abuse by allocating a new one and effectively clearing it. This broke pipelines such as $ time for i in . ; do : ; done /bin/ksh: : is read only Prompted by tb, OK millert, tb, jca
* Count $SECONDS with CLOCK_MONOTONIC.cheloha2018-04-131-5/+12
| | | | | | Keeps $SECONDS advancing uniformly and independent of wall clock jumps. ok jca@
* Support 64 bit integers on 32 bit architectures.tobias2018-04-0914-58/+61
| | | | | | | 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
* Fix spacing in brace command list grammar.anton2018-03-311-3/+3
| | | | Initial diff by me, later improved by schwarze@; also ok jmc@
* improve markup quality in the cases found by the new "--" style messageschwarze2018-03-161-6/+6
|
* Favor usage of __func__ in warning/error messages. Some of them referred to theanton2018-03-1513-84/+80
| | | | | | | wrong function and fix the rest for consistency. Diff from Michael W. Bombardieri with some cosmetic cleanup applied. ok benno@ tb@
* Clarify that the "bind" built-in command only affects Emacs editingschwarze2018-02-061-3/+8
| | | | | | | mode, to avoid potential confusion pointed out by andreas dot kahari at icm dot uu dot se on misc@. Patch minimally tweaked based on a comment from jmc@. OK anton@ jca@ jmc@ on the previous version without the tweak.
* Remove code that has been disabled since 1999. From Michael W. Bombardieri whoanton2018-01-201-18/+1
| | | | | | | also took the time to provide an excellent explanation on why the code isn't useful on tech@. ok jca@
* Introduce internal_warningf() and mark internal_errorf() as noreturnjca2018-01-1617-79/+97
| | | | | This helps tools like scan-build, and follows the example of warningf() and errorf(). ok anton@
* Stop constructing the ulimit optstring passed to ksh_getopt() at runtime sinceanton2018-01-161-16/+2
| | | | | | it's rarely subject to change. While here, unifdef RLIMIT_VMEM. ok jca@
* One minor scan-build warningjca2018-01-161-2/+2
| | | | emacs.c:1041:2: warning: Value stored to 'cp' is never read
* Don't try to open HISTFILE if the variable is unset.jca2018-01-151-4/+3
| | | | | | | str_val returns null, not NULL, if the variable isn't set. The erroneous check means that we later tried to open(""). ok millert@ tb@ anton@ benno@
* Stop pretending we support building ksh without EDIT/HISTORY supportjca2018-01-1511-108/+33
| | | | ok anton@
* unifdef BRACE_EXPAND; ok jca@anton2018-01-146-32/+9
|
* remove unused parameter from the static function print_expansions();schwarze2018-01-131-6/+6
| | | | | patch from Michael W. Bombardieri <mb at ii dot net>; OK tb@
* Some more tweaks to NOTESjca2018-01-121-11/+6
| | | | | | | | | | | | - it's safe to assume that there's no plan to write "an `agent' to execute unreadable/setuid/setgid shell scripts" - the BUG-REPORTS file has been removed - update the entry for FPATH, ksh93 also documents the described behavior - kill entry about octal and hex notation in arithmetic expressions (supported) - typos Feedback from Klemens Nanni
* update comments that were left behind in the recent unifdef JOB commitbenno2018-01-081-15/+15
| | | | from Klemens Nanni, thanks.
* Drop two outdated entriesjca2018-01-081-6/+2
| | | | | | Namely POSIX character classes and tilde expansion within parameter substitution. While here, kill a useless line and fix a typo. From Klemens Nanni
* Remove unused "args" param from kb_add(), it is always NULL.millert2018-01-081-99/+99
| | | | OK anton@ jca@
* Kill entries that are obviously outdated/out of scopejca2018-01-081-47/+2
| | | | Pointed out by Klemens Nanni who had ~ the same diff
* Add proper bounds checking to kb_add(). OK anton@millert2018-01-071-11/+12
|
* Bring back the sign compare changes, this time with a fix from otto@millert2018-01-0615-86/+95
| | | | that fixes the issues seen on hppa. OK deraadt@ otto@
* unifdef JOBS supportjca2018-01-056-72/+9
| | | | | Prompted by a mail from Klemens Nanni, who also had the same diff. ok deraadt@ millert@
* Typos in comments: 'it' -> 'if' and 'noityf' -> 'notify'.tb2018-01-051-3/+3
| | | | from Klemens Nanni
* Back out sign compare changes that appear to cause problems on hppa.millert2018-01-0414-90/+81
| | | | Requested by deraadt@
* Add WARNINGS=yes to ksh and fix the resulting sign compare warnings.millert2018-01-0114-81/+90
| | | | OK tb@
* backslash also escapes newlines when quoted;jmc2017-12-301-4/+4
| | | | from kshe
* Add -Wshadow to Makefile and fix the resulting warnings. Many ofmillert2017-12-2712-70/+66
| | | | | | | 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@
* The hack for /dev/fd support on systems without it was removed amillert2017-12-261-27/+18
| | | | | | | | long time ago. Update the comments and replace test_stat() calls with stat() since test_stat() now just calls stat() directly. Also rename the "mode" parameter to "amode" in test_eaccess() to match access(2) and make it clear that this is the access mode and not the file mode. OK jca@
* Get rid of a todo by stop declaring variable texec as static and instead zeroinganton2017-12-181-2/+3
| | | | | | it out prior to continuing down the recursive call chain. Initial diff from Michael W. Bombardieri, later tweaked; ok tb@
* Add another pair of home/end key bindings; from Lari Rasku.anton2017-12-181-1/+3
| | | | ok jca@
* oops - previous should have been a list item;jmc2017-12-151-4/+4
|
* Document change in the default shell prompts.tb2017-12-122-10/+15
| | | | Discussed with and ok jmc
* Include hostname in shell prompts by defaulttb2017-12-122-4/+5
| | | | | | | | | | | | | | | With tmux, ssh and vmd, we tend to open shells on many different hosts simultaneously and the default prompts '$ ' and '# ' for {,k}sh as well as '% ' and '# ' for csh become dangerous: it's very easy to issue a command on the wrong host. This can easily be avoided by displaying the hostname in the prompt. Everything beyond "hostname{$,#,%} " is going to be a matter of taste, so we left it at that. If you use an FQDN, only the first part (the output of 'hostname -s') will be printed. requested by and ok deraadt; mostly positive feedback many ok anton, brynet, bcallah and others
* Drop the unused second argument from set_prompt(). It used to be used fortb2017-12-074-9/+9
| | | | | | | | early special casing of ! and !! in the PS1 expansion. This was removed from set_prompt() as part of the implementaion of the character count toggles \[ and \] back in 2004. ok jca
* Follow emacs mode and remove the interactive "version" function.tb2017-11-271-19/+2
| | | | ok jca, anton (who both had the same diff) and deraadt
* Remove the "version" interactive function in emacs mode.jca2017-11-261-32/+1
| | | | Not bound by default and not very useful. ok schwarze@ anton@
* Fix some incorrectness related to Emacs editing mode in ksh:anton2017-11-222-11/+17
| | | | | | | | - Keep the order of bindings in sync between the manual and implementation - Fix wrongly documented bindings in the manual - Break out commands without a default binding in the manual ok jmc@ tb@
* Initialize *histbase to NULL to fix a bus error in emacs editing modetb2017-11-211-1/+2
| | | | | | | found by anton. To reproduce, run "env EDITOR=emacs MALLOC_OPTIONS=J ksh" then press "^[_". ok anton, jca
* Switch calloc(3) back to malloc(3). The call to calloc was introducedtb2017-11-021-2/+2
| | | | | | | | | | by the plaintext history diff, but the code that may have depended on this was since removed from history.c. None of the code introduced between the plaintext history commit and now depends on calloc(3). This way we can again use malloc.conf(5)'s J option to recognize use of uninitialized memory. ok jca
* Kill needless rewind(3) call in hist_init()jca2017-10-231-3/+1
| | | | | We may have read two bytes from the file, but history_load() needs to call rewind(3) anyway. ok benno@
* Skip (and warn about) overlong history lines.jca2017-10-231-7/+22
| | | | | With much input from Ori Bernstein and anton@; ok anton@ (and benno@ on a previous version).
* Delete the deprecated emacs-usemeta option.jca2017-10-192-18/+3
| | | | ok tb@ anton@
* The return value of this function isn't used.jca2017-10-181-6/+4
| | | | ok anton@ tb@
* Keep histptr inside of the allocated history arrayjca2017-09-071-4/+12
| | | | | | histptr == history -1 means that the history is empty, but the behavior is then undefined. Allocate an extra array entry to work around this. Input & ok tb@
* Use PATH_MAX instead of a local definejca2017-09-033-6/+6
| | | | okk deraadt@ millert@ anton@
* whitespace commit from BCderaadt2017-09-021-2/+2
|
* ignoredups implementation quirkjca2017-08-311-1/+5
| | | | Reminded by tb@
* Guard FEMACSUSEMETA uses behind #ifdef EMACSjca2017-08-301-1/+7
|
* Implement HISTCONTROL ignoredups & ignorespace featuresjca2017-08-305-18/+70
| | | | | | | | 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@