History log of /openbsd-src/bin/ksh/misc.c (Results 1 – 25 of 78)
Revision Date Author Comments
# 12854997 24-Dec-2021 deraadt <deraadt@openbsd.org>

when getopts prints "unknown option" or "requires argument", it should
not print the shell script line number where this occured. Doing so is
pointless, or an information leak.
This change does not

when getopts prints "unknown option" or "requires argument", it should
not print the shell script line number where this occured. Doing so is
pointless, or an information leak.
This change does not affect any other error reporting.
ok millert

show more ...


# 993f8b84 15-Dec-2021 deraadt <deraadt@openbsd.org>

getcwd() operates on buffers of PATH_MAX including the NUL, and the +1
is not unneccesary. Different buffer sizes are actually dangerous, though
major problems are strangely rare.
ok millert


# 574b77e1 26-Oct-2020 tb <tb@openbsd.org>

In lib/libc/gen/charclass.h r1.3 guenther made cclasses const.
Mark the pointer used to walk the array in ksh const as well.

From Matthew Martin

ok guenther


# 0db84b27 22-Jul-2020 millert <millert@openbsd.org>

Collapse consecutive stars to avoid exponential behavior.
OK tb@


# cbb0b321 07-Jul-2020 jca <jca@openbsd.org>

Add support for set -o pipefail

With the pipefail option set, the exit status of a pipeline is 0 if all
commands succeed, or the return status of the rightmost command that
fails. This can help str

Add support for set -o pipefail

With the pipefail option set, the exit status of a pipeline is 0 if all
commands succeed, or the return status of the rightmost command that
fails. This can help stronger error checking, but is not a silver
bullet. For example, commands will exhibit a non-zero exit status if
they're killed by a SIGPIPE when writing to a pipe. Yet pipefail was
considered useful enough to be included in the next POSIX standard.

This implementation remembers the value of the pipefail option when
a pipeline is started, as described as option 1) in

https://www.austingroupbugs.net/view.php?id=789#c4102

Requested by ajacoutot@, ok millert@

show more ...


# 3aaa63eb 28-Jun-2019 deraadt <deraadt@openbsd.org>

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if

When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

show more ...


# f56dcaa1 20-Nov-2018 deraadt <deraadt@openbsd.org>

Convert the pledge call to idiomatic format 'cause we love grep.


# 0995ade0 16-Nov-2018 nicm <nicm@openbsd.org>

Include "id" in pledge (for setres[ug]id, setgroups) if the shell is
privileged and remove it when dropping privileges (set +p), setting a
flag to make sure we don't do it again.

ok deraadt millert


# 517d3880 09-Apr-2018 tobias <tobias@openbsd.org>

Support 64 bit integers on 32 bit architectures.

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


# 97445c82 15-Mar-2018 anton <anton@openbsd.org>

Favor usage of __func__ in warning/error messages. Some of them referred to the
wrong function and fix the rest for consistency.
Diff from Michael W. Bombardieri with some cosmetic cleanup applied.

Favor usage of __func__ in warning/error messages. Some of them referred to the
wrong function and fix the rest for consistency.
Diff from Michael W. Bombardieri with some cosmetic cleanup applied.

ok benno@ tb@

show more ...


# 6c72b531 16-Jan-2018 jca <jca@openbsd.org>

Introduce internal_warningf() and mark internal_errorf() as noreturn

This helps tools like scan-build, and follows the example of warningf()
and errorf(). ok anton@


# 3dc0c5b1 15-Jan-2018 jca <jca@openbsd.org>

Stop pretending we support building ksh without EDIT/HISTORY support

ok anton@


# 9a36d1f0 14-Jan-2018 anton <anton@openbsd.org>

unifdef BRACE_EXPAND; ok jca@


# 4c503bcd 06-Jan-2018 millert <millert@openbsd.org>

Bring back the sign compare changes, this time with a fix from otto@
that fixes the issues seen on hppa. OK deraadt@ otto@


# c9653cd6 05-Jan-2018 jca <jca@openbsd.org>

unifdef JOBS support

Prompted by a mail from Klemens Nanni, who also had the same diff.
ok deraadt@ millert@


# 60ccd8d7 04-Jan-2018 millert <millert@openbsd.org>

Back out sign compare changes that appear to cause problems on hppa.
Requested by deraadt@


# 43da03fc 01-Jan-2018 millert <millert@openbsd.org>

Add WARNINGS=yes to ksh and fix the resulting sign compare warnings.
OK tb@


# 201e0776 27-Dec-2017 millert <millert@openbsd.org>

Add -Wshadow to Makefile and fix the resulting warnings. Many of
the warnings are due to the use of globals with generic names,
specifically "options" and "path". I've renamed "options" to
"sh_opti

Add -Wshadow to Makefile and fix the resulting warnings. Many of
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@

show more ...


# 57b15f1f 19-Oct-2017 jca <jca@openbsd.org>

Delete the deprecated emacs-usemeta option.

ok tb@ anton@


# 6776170a 30-Aug-2017 jca <jca@openbsd.org>

Guard FEMACSUSEMETA uses behind #ifdef EMACS


# 497e8e71 30-Aug-2017 jca <jca@openbsd.org>

Stop exposing the emacs-usemeta option, and warn when trying to set it.

Unused since 2012, to be removed after 6.2. Input from anton@,
ok anton@ millert@


# 51c2de25 04-Jul-2017 anton <anton@openbsd.org>

Backout previous due to a bug discovered by zhuk@ that requires some tinkering
and is not an easy fix for now.


# be48121b 04-Jul-2017 anton <anton@openbsd.org>

Add support for pattern substitution to variables in ksh using a common syntax
borrowed from ksh93.

Survived a ports build performed by naddy@ and encouraged by many.


# 83094010 20-Mar-2016 krw <krw@openbsd.org>

Currently we have about a 50/50 split over fcntl(n, F_GETFL [,0])
idioms.

Adopt the more concise fcntl(n, F_GETFL) over fcntl(n, F_GETFL, 0)
where it is obvious further investigation will not yield

Currently we have about a 50/50 split over fcntl(n, F_GETFL [,0])
idioms.

Adopt the more concise fcntl(n, F_GETFL) over fcntl(n, F_GETFL, 0)
where it is obvious further investigation will not yield and
even better way.

Obviousness evaluation and ok guenther@

show more ...


# 2a18d20e 06-Mar-2016 natano <natano@openbsd.org>

Make set +o conform with POSIX.

It should be possible to use set +o to save the current shell options,
then modify them at will and later restore them to the saved value.
Therefore the output must n

Make set +o conform with POSIX.

It should be possible to use set +o to save the current shell options,
then modify them at will and later restore them to the saved value.
Therefore the output must not only contain the options which are
currently set, but also the ones that are _not_ set, so a restore
disables them if they are enabled.

from Martijn Dekker (martijn (at) inlv (dot) org)
ok sthen@, tb@

show more ...


1234