summaryrefslogtreecommitdiff
path: root/bin
AgeCommit message (Collapse)Author
2018-02-06Clarify that the "bind" built-in command only affects Emacs editingIngo Schwarze
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.
2018-02-05CKSUM_DIGEST_STRING_LENGTH bounding didn't include full range of size_tTheo de Raadt
and NUL ok millert krw tb
2018-02-04use sizeof, rather than the constant. on change in binary.Theo de Raadt
2018-02-04repair ugly indentsTheo de Raadt
2018-02-04Print strtonum(3)-style error messages on invalid numeric input.cheloha
More informative than the usage message. While here, no need to return EINVAL: just return 1 if we overflow. ok jca@ schwarze@
2018-02-02Extend range for seconds from 100 million to upper bound of time_t.cheloha
Makes us compliant with POSIX.1-2008, which requires that sleep(1) support up to 2147483647 seconds. Bounced off of tb@ and jca@. ok tb@ millert@ jca@
2018-01-20Remove code that has been disabled since 1999. From Michael W. Bombardieri whoanton
also took the time to provide an excellent explanation on why the code isn't useful on tech@. ok jca@
2018-01-16Introduce internal_warningf() and mark internal_errorf() as noreturnJeremie Courreges-Anglas
This helps tools like scan-build, and follows the example of warningf() and errorf(). ok anton@
2018-01-16Stop constructing the ulimit optstring passed to ksh_getopt() at runtime sinceanton
it's rarely subject to change. While here, unifdef RLIMIT_VMEM. ok jca@
2018-01-16One minor scan-build warningJeremie Courreges-Anglas
emacs.c:1041:2: warning: Value stored to 'cp' is never read
2018-01-15Don't try to open HISTFILE if the variable is unset.Jeremie Courreges-Anglas
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@
2018-01-15Stop pretending we support building ksh without EDIT/HISTORY supportJeremie Courreges-Anglas
ok anton@
2018-01-14unifdef BRACE_EXPAND; ok jca@anton
2018-01-13remove unused parameter from the static function print_expansions();Ingo Schwarze
patch from Michael W. Bombardieri <mb at ii dot net>; OK tb@
2018-01-12Some more tweaks to NOTESJeremie Courreges-Anglas
- 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
2018-01-09Rename test file =.err to eq.err for simpler make file scripts.Alexander Bluhm
2018-01-08update comments that were left behind in the recent unifdef JOB commitSebastian Benoit
from Klemens Nanni, thanks.
2018-01-08Drop two outdated entriesJeremie Courreges-Anglas
Namely POSIX character classes and tilde expansion within parameter substitution. While here, kill a useless line and fix a typo. From Klemens Nanni
2018-01-08Remove unused "args" param from kb_add(), it is always NULL.Todd C. Miller
OK anton@ jca@
2018-01-08Kill entries that are obviously outdated/out of scopeJeremie Courreges-Anglas
Pointed out by Klemens Nanni who had ~ the same diff
2018-01-07Add proper bounds checking to kb_add(). OK anton@Todd C. Miller
2018-01-06Bring back the sign compare changes, this time with a fix from otto@Todd C. Miller
that fixes the issues seen on hppa. OK deraadt@ otto@
2018-01-05unifdef JOBS supportJeremie Courreges-Anglas
Prompted by a mail from Klemens Nanni, who also had the same diff. ok deraadt@ millert@
2018-01-05Typos in comments: 'it' -> 'if' and 'noityf' -> 'notify'.Theo Buehler
from Klemens Nanni
2018-01-04Back out sign compare changes that appear to cause problems on hppa.Todd C. Miller
Requested by deraadt@
2018-01-03Stop "dd if=/dev/zero of=/dev/null bs=1 count=2 skip=0x7fffffffffffffff"Ingo Schwarze
from erroring out with "dd: skip: Undefined error: 0", mostly for consistency and to avoid the unidiomatic, wrong looking code. Patch from Bulat Musin <mbulatka at yandex dot ru>. OK guenther@ millert@
2018-01-01Add WARNINGS=yes to ksh and fix the resulting sign compare warnings.Todd C. Miller
OK tb@
2017-12-30backslash also escapes newlines when quoted;Jason McIntyre
from kshe
2017-12-27Add -Wshadow to Makefile and fix the resulting warnings. Many ofTodd C. Miller
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@
2017-12-26The hack for /dev/fd support on systems without it was removed aTodd C. Miller
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@
2017-12-23As we only use the .tv_sec field, simplify gettimeofday(2) -> time(3).cheloha
While here, use err(3) instead of errx(3) if adjtime(2) fails. Discussed/tweaked with/by tb@ and jca@. ok tb@ jca@
2017-12-18Get rid of a todo by stop declaring variable texec as static and instead zeroinganton
it out prior to continuing down the recursive call chain. Initial diff from Michael W. Bombardieri, later tweaked; ok tb@
2017-12-18No need to declare variable name as static in dounsetenv(). Also, drop aanton
redundant call to free() since name is always freed upon return. From Michael W. Bombardieri, with some tweaks by myself.
2017-12-18Add another pair of home/end key bindings; from Lari Rasku.anton
ok jca@
2017-12-16Passing NULL to free() is fine; from Michael W. Bombardieri.anton
2017-12-15oops - previous should have been a list item;Jason McIntyre
2017-12-12Document change in the default shell prompts.Theo Buehler
Discussed with and ok jmc
2017-12-12Include hostname in shell prompts by defaultTheo Buehler
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
2017-12-08Convert snprintf+write into dprintf. It is simply easier to read, andTheo de Raadt
provides retry on short-write file descriptors. ok florian, previous versions seen by millert
2017-12-07Drop the unused second argument from set_prompt(). It used to be used forTheo Buehler
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
2017-11-27Follow emacs mode and remove the interactive "version" function.Theo Buehler
ok jca, anton (who both had the same diff) and deraadt
2017-11-26Remove the "version" interactive function in emacs mode.Jeremie Courreges-Anglas
Not bound by default and not very useful. ok schwarze@ anton@
2017-11-22Fix some incorrectness related to Emacs editing mode in ksh:anton
- 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@
2017-11-21Initialize *histbase to NULL to fix a bus error in emacs editing modeTheo Buehler
found by anton. To reproduce, run "env EDITOR=emacs MALLOC_OPTIONS=J ksh" then press "^[_". ok anton, jca
2017-11-16In revision 1.35 of file.c, tenex() was modified to respect the inputline_sizeanton
argument but I forgot to adapt one conditional. Still no functional change since tenex() only has one call site where `inputline_size == sizeof(buf)`.
2017-11-16Zap a redundant cast.anton
2017-11-02Switch calloc(3) back to malloc(3). The call to calloc was introducedTheo Buehler
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
2017-10-24When dd(1) fails because it receives an INT signal,Ingo Schwarze
exit with a non-zero EXIT STATUS, as required by POSIX, consistent with what other operating systems do, consistent with how other OpenBSD programs behave, and making wait(2) consistent with what happens when dd(1) dies from other signals. Patch from <ScottCheloha at gmail dot com>. OK florian@ tb@.
2017-10-23Kill needless rewind(3) call in hist_init()Jeremie Courreges-Anglas
We may have read two bytes from the file, but history_load() needs to call rewind(3) anyway. ok benno@
2017-10-23Skip (and warn about) overlong history lines.Jeremie Courreges-Anglas
With much input from Ori Bernstein and anton@; ok anton@ (and benno@ on a previous version).