summaryrefslogtreecommitdiff
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* Rename P_KTHREAD struct proc p_flag to P_KPROC.Konstantin Belousov2016-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 Notes: svn path=/head/; revision=295435
* Improve comment to reflect recent changes.Edward Tomasz Napierala2016-02-091-2/+4
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=295428
* Use a proper type for return value of postfix_to_mult(); the way it'sEdward Tomasz Napierala2016-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 Notes: svn path=/head/; revision=295427
* Use proper functions for parsing the numeric values.Edward Tomasz Napierala2016-02-091-2/+2
| | | | | | | | | Submitted by: bde@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=295426
* Add 't' and 'p' postfixes to dd(1).Edward Tomasz Napierala2016-02-042-2/+13
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=295261
* Reduce code duplication.Edward Tomasz Napierala2016-02-041-48/+34
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=295260
* Don't link /usr/share/nls/de_DE.UTF-8/tcsh.cat to itself.Bryan Drewery2016-02-031-1/+1
| | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=295224
* The charset of NLS catalogs were converted to UTF-8Hajimu UMEMOTO2016-02-031-29/+28
| | | | | | | since r231990. Notes: svn path=/head/; revision=295204
* Make dynamic link of libiconv from ports work again.Hajimu UMEMOTO2016-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 Notes: svn path=/head/; revision=295147
* sh: Don't allocate a redirtab if there are no redirections.Jilles Tjoelker2016-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. Notes: svn path=/head/; revision=295085
* sh(1): Document 'cd -'.Jilles Tjoelker2016-01-301-6/+19
| | | | | | | | This reflects the changes in r294649 and can therefore not be MFCed by itself. Notes: svn path=/head/; revision=295083
* test: Optimize operator lookup.Jilles Tjoelker2016-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. Notes: svn path=/head/; revision=295082
* sh: Constify internal representation in expand.c.Jilles Tjoelker2016-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'. Notes: svn path=/head/; revision=294692
* sh: Remove a global variable from cd.c.Jilles Tjoelker2016-01-241-14/+15
| | | | Notes: svn path=/head/; revision=294667
* sh: Use OLDPWD shell variable for 'cd -'.Jilles Tjoelker2016-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. Notes: svn path=/head/; revision=294649
* Don't mention the "canonical six" in setfacl(1); it describes semanticsEdward Tomasz Napierala2016-01-231-3/+4
| | | | | | | | | | that's long gone. MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=294626
* sh: Clean a readonly local, even if the variable does not exist outside.Jilles Tjoelker2016-01-223-0/+12
| | | | | | | | If a local variable has been made read-only, this should not prevent its removal when the function returns. Notes: svn path=/head/; revision=294593
* sh: Add already working test for local-readonly interaction.Jilles Tjoelker2016-01-222-0/+11
| | | | Notes: svn path=/head/; revision=294582
* sh: Simplify some code related to positional parameters.Jilles Tjoelker2016-01-192-17/+13
| | | | Notes: svn path=/head/; revision=294348
* sh: Update associated state when restoring locals while leaving a function.Jilles Tjoelker2016-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. Notes: svn path=/head/; revision=293635
* sh: Reduce size of options table.Jilles Tjoelker2016-01-074-71/+71
| | | | Notes: svn path=/head/; revision=293392
* sh: Add a test for 'cd -'.Jilles Tjoelker2016-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. Notes: svn path=/head/; revision=293371
* sh: Ensure OPTIND=1 in subshell without forking does not affect outer env.Jilles Tjoelker2016-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). Notes: svn path=/head/; revision=293359
* sh: Link tests/builtins/getopts9.0 to the build.Jilles Tjoelker2016-01-031-0/+1
| | | | | | | This was forgotten in r273700. Notes: svn path=/head/; revision=293120
* sh: Reduce size of builtins table.Jilles Tjoelker2016-01-032-15/+12
| | | | Notes: svn path=/head/; revision=293118
* sh: Remove redundant CTLQUOTEMARK checks.Jilles Tjoelker2015-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). Notes: svn path=/head/; revision=293002
* sh: Reindent expandmeta().Jilles Tjoelker2015-12-311-21/+21
| | | | Notes: svn path=/head/; revision=292995
* sh: Perform pathname generation during the first expansion phases.Jilles Tjoelker2015-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. Notes: svn path=/head/; revision=292994
* sh: Perform IFS splitting during the first expansion phases.Jilles Tjoelker2015-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. Notes: svn path=/head/; revision=292991
* sh: Split subevalvar() in #/##/%/%% and =/? parts.Jilles Tjoelker2015-12-291-28/+45
| | | | Notes: svn path=/head/; revision=292887
* pax: prevent possible buffer overflowPedro F. Giffuni2015-12-291-1/+1
| | | | | | | | | | | Or at least quiet down some static analyzers about it. CID: 978835 MFC after: 1 week Obtained from: OpenBSD Notes: svn path=/head/; revision=292877
* sh: Add tests for #/##/%/%% on $* and $@.Jilles Tjoelker2015-12-262-0/+62
| | | | | | | | Although POSIX leaves things like ${*#X} unspecified, it occasionally occurs in practice. Add some tests that seem to work sensibly. Notes: svn path=/head/; revision=292758
* sh/mknodes: Close files and check for errors when writing.Jilles Tjoelker2015-12-201-5/+15
| | | | | | | | | | This is a build tool only and does not affect run time. PR: 204951 MFC after: 1 week Notes: svn path=/head/; revision=292517
* ed(1): Prevent possible string overflowsPedro F. Giffuni2015-12-181-4/+4
| | | | | | | | | | | Use strlcpy instead of strncpy to guarantee NULL termination. Pointed out by: imp CID: 1007252 X-MFC with: r292454 Notes: svn path=/head/; revision=292455
* ed(1): Prevent possible string overflowsPedro F. Giffuni2015-12-181-4/+6
| | | | | | | | CID: 1007252 MFC after: 2 weeks Notes: svn path=/head/; revision=292454
* sh: Fix use-after-free when attempting to modify a read-only variable.Jilles Tjoelker2015-12-161-1/+1
| | | | | | | | Reported by: bapt MFC after: 1 week Notes: svn path=/head/; revision=292360
* Fix ls -l alignement with new localesBaptiste Daroussin2015-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 Notes: svn path=/head/; revision=291959
* Add missing CLEANFILES.Bryan Drewery2015-12-071-1/+1
| | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291942
* Enable bin/ls testcases disabled previously because of issues with howEnji Cooper2015-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 Notes: svn path=/head/; revision=291919
* sh: Add limited test for ${#@} and ${#*}.Jilles Tjoelker2015-12-062-0/+19
| | | | | | | | POSIX leaves the result of expanding ${#@} and ${#*} unspecified, but ensure it is numeric. Notes: svn path=/head/; revision=291903
* sh: Link tests/parameters/positional8.0 to the build.Jilles Tjoelker2015-12-051-0/+1
| | | | | | | This was forgotten in r291025. Notes: svn path=/head/; revision=291857
* Fix spelling, as recommended by igor tool.Craig Rodrigues2015-12-011-1/+1
| | | | Notes: svn path=/head/; revision=291608
* Add more text to explain --libxo flag.Craig Rodrigues2015-12-013-3/+24
| | | | Notes: svn path=/head/; revision=291607
* Update dependencies after r291406 added libelf to libkvm.Bryan Drewery2015-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 Notes: svn path=/head/; revision=291558
* META MODE: Don't create .meta files when symlinking sources into the obj ↵Bryan Drewery2015-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 Notes: svn path=/head/; revision=291320
* sh: Remove global state from nodes.c.Jilles Tjoelker2015-11-242-38/+46
| | | | | | | No functional change is intended. Notes: svn path=/head/; revision=291267
* Remove unneeded libutil dependency for sendmail.Bryan Drewery2015-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 Notes: svn path=/head/; revision=291235
* sh: Fix ""$@, which should not use the special case for "$@".Jilles Tjoelker2015-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. Notes: svn path=/head/; revision=291025
* Protecting against rm -rf / is now POSIXLY_CORRECT per posix 1003.1Baptiste Daroussin2015-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 Notes: svn path=/head/; revision=290480
* sh: Avoid copying argv for simple commands.Jilles Tjoelker2015-11-013-11/+11
| | | | | | | | Add dummy entries before and after so arglist's array is directly usable as argv. Notes: svn path=/head/; revision=290244