sh(1): bring sh from freebsdI used freebsd@19bed3ae2eb256a2c68dabbcb77eff2835d569de.* Write absolute path in command -vV and type* Keep ignored SIGINT/SIGQUIT after set in a background job* pri
sh(1): bring sh from freebsdI used freebsd@19bed3ae2eb256a2c68dabbcb77eff2835d569de.* Write absolute path in command -vV and type* Keep ignored SIGINT/SIGQUIT after set in a background job* print a newline when ^D quits sh* Do not ignore INTOFF during a trap* Fix description of the "\$" sequence for PS1* Allow more scripts without #!* Fix double INTON with vfork* Assert INTOFF rather than applying it in ck** Remove remnants to compile out fc completely* Fix a "may be unused" warning on mips-gcc* remove duplicate el definition* fix read builtin on 32-bit systems* Improve performance of "read" built-in command when using a seekable* Fix rare memory leak with SIGINT* Do not use our custom completion function, it is not needed anymore* Add set -o pipefail* Send normal output from bind builtin to stdout* Restore $((x)) error checking after fix for $((-9223372036854775808))* Make sh(1) support \u in PS1. This removes one fork/exec on interactive* Send libedit "ferr" output to fd 2* Fix an edge case when parsing large numbers which resulted in inconsistent* Do not place exported but unset variables into the environment* Make sh(1) collapse $HOME into "~" in PS1.* Remove -c string from set builtin documentation* Fix ${param?} default error message* Use 126 and 127 exit status for failures opening a script* Unify EXERROR and EXEXEC* Use exitstatus instead of exerrno to pass EXEXEC status* Fix formal overflow in pointer arithmetic* Describe how to prevent *.core files from being created using ulimit.* Don't treat % specially in CDPATH* Don't use padvance() for MAIL/MAILPATH* Split CNL syntax category to avoid a check on state[level].syntax* Allow unquoted newlines in word in ${param+word} etc.* Don't have [ match any [[:class:]]* Allow overriding VTABSIZE at compile-time.* Refactor job status printing, preparing for -o pipefail and similar* Move various structs from jobs.h to jobs.c* Fix a few speelling errors* Don't leak wait* implementation details from jobs.c* Markup and spelling fixes* Fix mandoc -Tlint warnings in bin/* General further adoption of SPDX licensing ID tags.* Remove broken #ifdef NOHACK code (related to sh -c).* Ignore error when cd writes the directory actually switched to.* Enable interrupts before executing EXIT trap and doing final flush.* Call fc -e editor with interrupts enabled.* Make sure to process SIGINT if SETINTON re-enables processing.* Allow defining nofork builtins from builtins.def and move always-safe ones there.* Fix INTOFF leak when a redirection on a compound command fails.* Keep output buffer across builtins.* Ensure memout.bufsize matches allocated buffer, if it exists.* Simplify output buffering.* Fix '-' from quoted arithmetic in case/glob pattern range.* Fix INTOFF leak after a builtin with different locale settings.* Update TOUR and comments for some code changes, some of them old.* Simplify handling of newlines in command substitution.* Simplify setinteractive().* Fix use after free when resetting an in-use alias.* Fix unalias -a while an alias is currently in use.* Reduce size of limits table.* Remove an XXX comment: it is normal for builtins to use argptr.* Remove global state from collate_range_cmp().* Don't scan word twice in ${param=word}.* Don't scan word twice in ${param#%##%%word}.* Don't scan word twice in ${param+-word}.* Remove unused function declaration for arith_lex_reset().* Remove unused return value of subevalvar_misc().* Get rid of global variable argbackq.* Fix executing wrong command with ${unsetvar#$(cmdsubst)}$(cmdsubst).* Fix crash if a -T trap is taken during command substitution.* bin: normalize paths using SRCTOP-relative paths or :H when possible* Remove empty Li* Do not import IFS's value from the environment.* Fix a clang warning.* Path generation was not according to collate* Back out non-collating [a-z] ranges.* After removing collation for [a-z] ranges in r302512, do it here too.* Improve descriptions in 'ulimit -a' output.* Clarify the explanations for the hostname and FQDN entries.* Match the descriptions of the \H and \h prompt string sequences to reality.* Hopefully fix Coverity CID 1008328 (Out-of-bounds write) in /bin/sh.* Handle empty hostname and $PWD when building prompt* Write LINENO value to stack string directly.* Merge the projects/release-pkg branch to head.* Simplify code by removing variable bracketed_name.* replace 0 with NULL for pointers.* Fix use-after-free if a trap replaces itself.* Fix copying uninitialized field 'special'.* Fix handling of umtxp resource limit in sh(1)/ulimit(1), limits(1), add* Avoid out-of-bounds access in setoptionbyindex() for 'set -o nolog'.* Fix some dead stores.* Remove a redundant STPUTC check.* Don't trust that signal descriptions fit within 49 bytes.* Fix set -v and multiline history after r295825.* Don't hash alias name when there are no aliases.* Optimize setprompt(0).* Remove unnecessary flushouts while reading script.* Rework code to remove '\0' from shell input.* Don't allocate a redirtab if there are no redirections.* Document 'cd -'.* Constify internal representation in expand.c.* Remove a global variable from cd.c.* Use OLDPWD shell variable for 'cd -'.* Clean a readonly local, even if the variable does not exist outside.* Simplify some code related to positional parameters.* Update associated state when restoring locals while leaving a function.* Reduce size of options table.* Ensure OPTIND=1 in subshell without forking does not affect outer env.* Reduce size of builtins table.* Remove redundant CTLQUOTEMARK checks.* Reindent expandmeta().* Perform pathname generation during the first expansion phases.* Perform IFS splitting during the first expansion phases.* Split subevalvar() in #/##/%/%% and =/? parts.* sh/mknodes: Close files and check for errors when writing.* Fix use-after-free when attempting to modify a read-only variable.* Remove global state from nodes.c.* Fix ""$@, which should not use the special case for "$@".* Avoid copying argv for simple commands.* Make struct arglist an array instead of a linked list.* Allow empty << EOF markers.* Fix read with escaped IFS characters at the end.* Add set -o nolog.* Fix out of bounds read when there is no ] after a [:class:].* Don't create bad parse result when postponing a bad substitution error.* Avoid negative character values from $'\Uffffffff' etc.* Backslash-newline should not affect field splitting in read builtin.* When setting option via long name, don't go via letter.* libedit has supported multibyte encodings for a while.* Fix some arithmetic undefined behaviour.Taken-from: FreeBSD
show more ...
sh: Sync with FreeBSD:* Expand assignment-like words specially for export/readonly/local.* Remove unused variables.* Reset pendingsigs before checking pending traps, not after.* Track continued
sh: Sync with FreeBSD:* Expand assignment-like words specially for export/readonly/local.* Remove unused variables.* Reset pendingsigs before checking pending traps, not after.* Track continued jobs (even if not continued by bg or fg).* Inline waitproc() into its only caller.* Fix EINTR race condition in "wait" and "set -T" using sigsuspend().* use setinputfile instead of open/setinputfd.* Prefer internal nextopt() to libc getopt().* Use C99 flexible array instead of accessing array beyond bounds.* Fix two issues when an alias is redefined.* Detect and flag write errors on stdout in builtins.* Prefer strsignal() to accessing sys_siglist directly.* Don't lose $? when backquoted command ends with semicolon or newline.* Fix crash when parsing '{ } &'.* Pass $? to command substitution containing compound/multiple commands.* Simplify cd-hash interaction.* Remove mkinit's initialization routine.* Move some stackmarks to fix high memory usage in some loops.* Show negated commands (!) in jobs output.* Prefer our character classification functions to <ctype.h>.* Expand here documents in the current process.* Do not test for digit_contig in mksyntax.* Simplify mksyntax* Fix a crash with the stackmark code.* If a SIGINT or SIGQUIT interrupts "wait", return status 128+sig.* When executing a trap, keep exit status along with evalskip.* Update $FreeBSD$ to include SVN id.Obtained-from: FreeBSD
sh: Detect an error for ${#var<GARBAGE>}.In particular, this makes things like ${#foo[0]} and ${#foo[@]} errorsrather than silent equivalents of ${#foo}.Obtained-from: FreeBSD SVN rev 221461
Add regression tests for /bin/sh.Obtained-from: FreeBSD