Age | Commit message (Collapse) | Author |
|
from kshe
|
|
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@
|
|
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@
|
|
While here, use err(3) instead of errx(3) if adjtime(2) fails.
Discussed/tweaked with/by tb@ and jca@.
ok tb@ jca@
|
|
it out prior to continuing down the recursive call chain.
Initial diff from Michael W. Bombardieri, later tweaked; ok tb@
|
|
redundant call to free() since name is always freed upon return.
From Michael W. Bombardieri, with some tweaks by myself.
|
|
ok jca@
|
|
|
|
|
|
Discussed with and ok jmc
|
|
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
|
|
provides retry on short-write file descriptors.
ok florian, previous versions seen by millert
|
|
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
|
|
ok jca, anton (who both had the same diff) and deraadt
|
|
Not bound by default and not very useful. ok schwarze@ 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@
|
|
found by anton. To reproduce, run "env EDITOR=emacs MALLOC_OPTIONS=J ksh"
then press "^[_".
ok anton, jca
|
|
argument but I forgot to adapt one conditional. Still no functional change since
tenex() only has one call site where `inputline_size == sizeof(buf)`.
|
|
|
|
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
|
|
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@.
|
|
We may have read two bytes from the file, but history_load() needs to
call rewind(3) anyway. ok benno@
|
|
With much input from Ori Bernstein and anton@; ok anton@ (and benno@ on
a previous version).
|
|
ok tb@ anton@
|
|
ok anton@ tb@
|
|
specify it more than once. Adapted from a diff by and OK schwarze@
|
|
|
|
on any sensible posix system (in which time_t must be an integer type)
ok deraadt@ millert@
|
|
This makes it possible to measure just the ellapsed user time, which
is what we really care about when benchmarking an algorithm.
OK deraadt@
|
|
ok millert@
|
|
with hint from millert@; ok millert@ guenther@
|
|
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@
|
|
conversion is involved. Cast the sizeof to int to get a signed compare;
ok deraadt@ bluhm@
|
|
okk deraadt@ millert@ anton@
|
|
|
|
Reminded by tb@
|
|
|
|
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@
|
|
Unused since 2012, to be removed after 6.2. Input from anton@,
ok anton@ millert@
|
|
ok anton@ millert@
|
|
|
|
|
|
call site where `inputline_size == sizeof(buf)`.
|
|
the input buffer instructs csh that the buffer contains a complete command. This
is wrong and should only happen when buffer is not full, otherwise more data has
to be read in order form a complete command.
While here, do not print the prompt again when the input exceeds the input
buffer and while inserting a line continuation (backslash).
|
|
Pointless since the removal of the setlocale() call in main.c:rev1.82,
the emacs-usemeta flag isn't used in the code since 2012. This kills
a chunk of code in a statically linked ksh.
ok millert@
|
|
Do not link ps(1) with libm.
from miod@; OK millert@
|
|
Dead code that could send the wrong hint to an unsuspicious reader. The
code should walk use 'history' & 'histptr' to walk the array.
ok millert@, "go for it" tb@
|
|
One method is enough: only access history lines between 'history' and
'histptr'. Pointers outside these bounds might be invalid.
ok millert@, "go for it" tb@
|
|
Cluebat & ok tb@
|
|
Report and diff by David Crosby <dave@dafyddcrosby.com>
OK otto@
|