summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* Rename P_KTHREAD struct proc p_flag to P_KPROC.kib2016-02-092-2/+2
| | | | | | | | I left as is an apparent bug in ntoskrnl_var.h:AT_PASSIVE_LEVEL() definition. Suggested by: jhb Sponsored by: The FreeBSD Foundation
* Improve comment to reflect recent changes.trasz2016-02-091-2/+4
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Use a proper type for return value of postfix_to_mult(); the way it'strasz2016-02-091-2/+2
| | | | | | | | being used wouldn't work if the value returned didn't fit in intmax_t. Submitted by: bde@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Use proper functions for parsing the numeric values.trasz2016-02-091-2/+2
| | | | | | Submitted by: bde@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Add 't' and 'p' postfixes to dd(1).trasz2016-02-042-2/+13
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Reduce code duplication.trasz2016-02-041-48/+34
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Don't link /usr/share/nls/de_DE.UTF-8/tcsh.cat to itself.bdrewery2016-02-031-1/+1
| | | | Sponsored by: EMC / Isilon Storage Division
* The charset of NLS catalogs were converted to UTF-8ume2016-02-031-29/+28
| | | | since r231990.
* Make dynamic link of libiconv from ports work again.ume2016-02-021-3/+3
| | | | | | | | | | | The symbols of libiconv from ports were changed to have prefixed. Since we have iconv in our libc these days, we don't need it on 10.X and later. However, 9.X still need this. Spotted by: Yoshihiko Sarumaru MFC after: 1 days
* sh: Don't allocate a redirtab if there are no redirections.jilles2016-01-301-7/+22
| | | | | | | | | | | | | | | | | Builtins (including variable assignments without command word), function calls and redirected compound commands need to restore file descriptors to their original state after execution. This is handled by allocating a redirtab structure. These mallocs and frees show up heavily in pmcstat. Only allocate a redirtab if there are actually redirections and maintain a count of how many levels of REDIR_PUSH there are without redirtabs. A simple loop without external programs like sh -c 'i=0; w=$(printf %0100d 7); while [ "$i" -lt 1000000 ]; do i=$((i+1)); done' is over 25% faster on an amd64 bhyve VM.
* sh(1): Document 'cd -'.jilles2016-01-301-6/+19
| | | | | This reflects the changes in r294649 and can therefore not be MFCed by itself.
* test: Optimize operator lookup.jilles2016-01-301-67/+97
| | | | | | | | | | | | | | The linear search using strcmp() shows up in pmcstat for several percent. Split the operators into lengths and whether they start with '-' and compare bytes using == instead of strcmp(). A simple test sh -c 'i=0; w=$(printf %0100d 7); while [ "$i" -lt 1000000 ]; do v=$(printf %sx%s "$w" "$w"); i=$((i+1)); done' is over 4% faster on an amd64 bhyve VM.
* sh: Constify internal representation in expand.c.jilles2016-01-241-22/+28
| | | | | | | Forbid (temporary or permanent) modifications of the strings in NARG nodes during expansion. Tilde expansion now needs to copy the username for the terminating '\0'.
* sh: Remove a global variable from cd.c.jilles2016-01-241-14/+15
|
* sh: Use OLDPWD shell variable for 'cd -'.jilles2016-01-231-10/+9
| | | | | | | | Per POSIX, 'cd -' should use the OLDPWD shell variable, not internal state. This variable is normally exported. Also, if OLDPWD is not set, fail 'cd -' instead of changing to the current directory.
* Don't mention the "canonical six" in setfacl(1); it describes semanticstrasz2016-01-231-3/+4
| | | | | | | that's long gone. MFC after: 1 month Sponsored by: The FreeBSD Foundation
* sh: Clean a readonly local, even if the variable does not exist outside.jilles2016-01-223-0/+12
| | | | | If a local variable has been made read-only, this should not prevent its removal when the function returns.
* sh: Add already working test for local-readonly interaction.jilles2016-01-222-0/+11
|
* sh: Simplify some code related to positional parameters.jilles2016-01-192-17/+13
|
* sh: Update associated state when restoring locals while leaving a function.jilles2016-01-104-2/+29
| | | | | | | | Some variables like PATH call a function when modified. Make sure to call this also when leaving a function where such a variable was made local. Make sure to restore local variables before shellparam, so getopts state is not clobbered.
* sh: Reduce size of options table.jilles2016-01-074-71/+71
|
* sh: Add a test for 'cd -'.jilles2016-01-073-0/+11
| | | | | | Redirect 'cd -' output to /dev/null since POSIX requires it to write the new directory name even if not interactive, but we currently only write it if interactive.
* sh: Ensure OPTIND=1 in subshell without forking does not affect outer env.jilles2016-01-073-0/+19
| | | | | | | | | | | | Command substitutions containing a single simple command and here-document expansion are performed in a subshell environment, but may not fork. Any modified state of the shell environment should be restored afterward. The state that OPTIND=1 had been done was not saved and restored here. Note that the other parts of shellparam need not be saved and restored, since they are not modified in these situations (a fork is done before such modifications).
* sh: Link tests/builtins/getopts9.0 to the build.jilles2016-01-031-0/+1
| | | | This was forgotten in r273700.
* sh: Reduce size of builtins table.jilles2016-01-032-15/+12
|
* sh: Remove redundant CTLQUOTEMARK checks.jilles2015-12-311-18/+2
| | | | | | | | With the new expand.c code, the intermediate representation passed to the pathname generation code only contains CTLESC, not CTLQUOTEMARK. CTLQUOTEMARK now only occurs in the text of NARG nodes (output of the parser).
* sh: Reindent expandmeta().jilles2015-12-311-21/+21
|
* sh: Perform pathname generation during the first expansion phases.jilles2015-12-312-52/+57
| | | | | | | | This avoids the need to add and remove CTLESC bytes if pathname generation will not be performed (set -f). Side effect: the order of operations is slightly different: pathname generation in ${$+* $(CMD)} will not see filesystem changes from CMD.
* sh: Perform IFS splitting during the first expansion phases.jilles2015-12-311-362/+253
| | | | | | | | | This simplifies the code and should be faster in some cases. Side effect: the order of operations is different so that the value of IFS used when IFS is modified during expansion (${IFS:=...}, ${IFS=...} or $((...IFS=...))) may be different. Note that this order is highly unportable between shells.
* sh: Split subevalvar() in #/##/%/%% and =/? parts.jilles2015-12-291-28/+45
|
* pax: prevent possible buffer overflowpfg2015-12-291-1/+1
| | | | | | | | Or at least quiet down some static analyzers about it. CID: 978835 MFC after: 1 week Obtained from: OpenBSD
* sh: Add tests for #/##/%/%% on $* and $@.jilles2015-12-262-0/+62
| | | | | Although POSIX leaves things like ${*#X} unspecified, it occasionally occurs in practice. Add some tests that seem to work sensibly.
* sh/mknodes: Close files and check for errors when writing.jilles2015-12-201-5/+15
| | | | | | | This is a build tool only and does not affect run time. PR: 204951 MFC after: 1 week
* ed(1): Prevent possible string overflowspfg2015-12-181-4/+4
| | | | | | | | Use strlcpy instead of strncpy to guarantee NULL termination. Pointed out by: imp CID: 1007252 X-MFC with: r292454
* ed(1): Prevent possible string overflowspfg2015-12-181-4/+6
| | | | | CID: 1007252 MFC after: 2 weeks
* sh: Fix use-after-free when attempting to modify a read-only variable.jilles2015-12-161-1/+1
| | | | | Reported by: bapt MFC after: 1 week
* Fix ls -l alignement with new localesbapt2015-12-071-1/+95
| | | | | | | | | | | | | Latest update of locales introduced abbreviated month that follows the regionale rules meaning that they can be of variable length instead of being arbitrary truncated to top 3 characters. To fix alignement, ls now computes the visible length of the abbreviated month, pads the shorter month with spaces in order to make sure everything is properly aligned Reviewed by: ache, ed, jilles Differential Revision: https://reviews.freebsd.org/D4239
* Add missing CLEANFILES.bdrewery2015-12-071-1/+1
| | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Enable bin/ls testcases disabled previously because of issues with howngie2015-12-071-6/+0
| | | | | | | | | | | kyua 0.11's version of report-junit was rendering non-printable characters Upgrade to kyua 0.12 to obtain a fixed version of the command Output verified with python 2.7.10's xml.dom.minidom module MFC after: 3 days Sponsored by: EMC / Isilon Storage Division
* sh: Add limited test for ${#@} and ${#*}.jilles2015-12-062-0/+19
| | | | | POSIX leaves the result of expanding ${#@} and ${#*} unspecified, but ensure it is numeric.
* sh: Link tests/parameters/positional8.0 to the build.jilles2015-12-051-0/+1
| | | | This was forgotten in r291025.
* Fix spelling, as recommended by igor tool.rodrigc2015-12-011-1/+1
|
* Add more text to explain --libxo flag.rodrigc2015-12-013-3/+24
|
* Update dependencies after r291406 added libelf to libkvm.bdrewery2015-12-012-0/+2
| | | | | | | | Unfortunately filemon/meta mode tracks all indirect dependencies here since ld(1) is reading libelf when linking in libkvm. Churn would be reduced if this was able to be limited to direct dependencies. Sponsored by: EMC / Isilon Storage Division
* META MODE: Don't create .meta files when symlinking sources into the obj ↵bdrewery2015-11-251-2/+2
| | | | | | | | | | | directory. Tracking these leads to situations where meta mode will consider the file to be out of date if /bin/sh or /bin/ln are newer than the source file. There's no reason for meta mode to do this as make is already handling the rebuild dependency fine. Sponsored by: EMC / Isilon Storage Division
* sh: Remove global state from nodes.c.jilles2015-11-242-38/+46
| | | | No functional change is intended.
* Remove unneeded libutil dependency for sendmail.bdrewery2015-11-241-1/+0
| | | | | | | | | It included libutil.h for setproctitle(3), which was moved from libutil to libc in r65353 in 2000. Reviewed by: gshapiro [sendmail change] Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D4261
* sh: Fix ""$@, which should not use the special case for "$@".jilles2015-11-182-1/+33
| | | | | "$@" should expand to no words if there are no positional parameters, but ""$@ should always expand to at least an empty word.
* Protecting against rm -rf / is now POSIXLY_CORRECT per posix 1003.1bapt2015-11-072-4/+3
| | | | | | | | | edition 2013. No need anymore to disable the protection if one set the POXILY_CORRECT environment variable. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D4092
* sh: Avoid copying argv for simple commands.jilles2015-11-013-11/+11
| | | | | Add dummy entries before and after so arglist's array is directly usable as argv.
OpenPOWER on IntegriCloud