| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
| |
musl libc defines the optreset BSD extension only in getopt.h. This
fixes the following build failure:
histedit.c: In function 'histcmd':
histedit.c:220:2: error: 'optreset' undeclared (first use in this function)
optreset = 1; optind = 1; /* initialize getopt */
^~~~~~~~
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
|
|
|
|
|
|
|
|
|
|
| |
The function dotrap calls evalstring using the stored trap string.
If evalstring then unsets that exact trap string then we will end
up using freed memory.
This patch fixes it by making evalstring always duplicate the string
before using it.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Solaris lacks paths.h and the various _PATH_* #defines.
Check for them in configure.ac and fall back on the
usual suspects when they are missing.
- Older Solaris lacks isblank(), and versions that have it
use a macro. Check for the declaration in configure.ac
and fall back on a naive version when missing.
- Older Solaris does not support %jd (intmax_t) in format
strings, but it does support the PRIdMAX macro from inttypes.h.
Do a configure check for PRIdMAX and use it in the code.
If it doesn't exist, define it to "lld" when sizeof(long long)
equals sizeof(intmax_t) as this is more likely to work on
older systems. Otherwise, use "jd" and hope for the best.
- Older Solaris lacks stdint.h, but inttypes.h provides the
same types and works on all platforms I've tried dash on,
so just use it instead.
- Older Solaris doesn't like it when vsnprintf() is passed
a NULL buffer (in violation of the POSIX spec, of course).
Pass a 1-byte dummy buffer instead.
- Solaris lacks tempfile and mktemp programs. Fall back on a
"good-enough" custom function in mkbuiltins.
Signed-off-by: Brian Koropoff <bkoropoff@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes the case where the eval command is used with
set -e and as part of a construct that should not cause the
shell to abort, e.g., as part of the condition of an if statement.
This is achieved by propagating the EV_TESTED flag into the
evalstring function through evalcmd. As this alters the prototype
of evalcmd it is now invoked explicitly by evalbltin. The built-in
infrastructure has been changed to accomodate this special case.
In order to ensure that the EXIT trap is properly executed this
patch clears evalskip in exitshell. This wasn't needed before
because of the broken way evalstring worked where it always clears
evalskip when called by minusc.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
|
|
|
|
| |
Now that mkbuiltins correctly disabled histcmd we don't need the dummy
histcmd implementation anymore.
|
|
|
|
|
|
|
|
|
|
|
| |
This change updates the BSD licence to the three-clause version since
NetBSD has already done so. This makes dash GPL-compatible.
It also adds Christos Zoulas (NetBSD ash maintainer) to the COPYING file.
I've added "copyright by Herbert Xu" to most files.
Finally all CVS IDs and inclusion of sys/cdefs.h have been removed.
The latter is needed for support of klibc.
|
|
|
|
|
|
| |
Let evaltree handle traps from cmdloop.
Reset evalskip after minusc is executed.
Stop executing traps once SKIPEVAL is seen.
|
| |
|
|
|