summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* mdoc: fix column names, indentation, column separation within each row, andjoel2012-04-072-2/+2
| | | | | | | quotation. Also make sure we have the same amount of columns in each row as the number of columns we specify in the head arguments. Reviewed by: brueffer
* sh: Fix build with -DDEBUG=2.jilles2012-04-021-2/+2
| | | | | Reported by: Kristof Provost MFC after: 1 week
* mandoc complains loudly when <TAB>s are misused in columnated lists. Fixjoel2012-03-291-31/+31
| | | | | this syntax violation and while I'm here also convert <TAB> to Ta and adjust quotation marks in order to prevent this problem in the future.
* Remove trailing whitespace per mdoc lint warningeadler2012-03-293-3/+3
| | | | | | | Disussed with: gavin No objection from: doc Approved by: joel MFC after: 3 days
* Remove superfluous paragraph macro.joel2012-03-254-6/+0
|
* rm[0].rm_so must be zero (an explicit check is made for zero in theeadler2012-03-191-1/+1
| | | | | | | outer if condition) Reviewed by: se Approved by: cperciva
* Document P_ORPHAN.kib2012-03-081-1/+2
| | | | MFC after: 3 days
* Bump date to today (since I modified it)eadler2012-03-031-1/+1
| | | | | | PR: bin/165321 Approved by: gjb MFC after: 3 days
* Direct users to swapinfo and pstat from dfeadler2012-03-031-0/+2
| | | | | | | PR: bin/165321 Submitted by: jhs Approved by: bcr MFC after: 3 days
* Whitespace cleanup:gjb2012-02-251-2/+4
| | | | | | | | | o Wrap sentences on to new lines o Cleanup trailing whitespace Found with: textproc/igor MFC after: 1 week X-MFC-With: r232157
* Fix various typos in manual pages.gjb2012-02-251-3/+3
| | | | | | Submitted by: amdmi3 PR: 165431 MFC after: 1 week
* Update to tcsh 6.18.01.mp2012-02-224-1169/+61
|
* sh: Make 'hash' return 1 if at least one utility is not found.jilles2012-02-111-8/+12
| | | | Reported by: lme
* sh: Fix swapped INTON/INTOFF.jilles2012-02-041-2/+2
| | | | | | | A possible consequence of this bug was a memory leak if SIGINT arrived during a 'set' command (listing variables). MFC after: 1 week
* sh: Use vfork in a few common cases.jilles2012-02-045-0/+64
| | | | | | | | | | | | | | | | | This uses vfork() for simple commands and command substitutions containing a single simple command, invoking an external program under certain conditions (no redirections or variable assignments, non-interactive shell, no job control). These restrictions limit the amount of code executed in a vforked child. There is a large speedup (for example 35%) in microbenchmarks. The difference in buildkernel is smaller (for example 0.5%) but still statistically significant. See http://lists.freebsd.org/pipermail/freebsd-hackers/2012-January/037581.html for some numbers. The use of vfork() can be disabled by setting a variable named SH_DISABLE_VFORK.
* Add prototypes, ANSIfy functions definitions to reduce WARNS=6 output.charnier2012-01-255-5/+6
|
* sh: Fix $? in the first command of a 'for'.jilles2012-01-221-1/+4
| | | | | | In the first command of a 'for', $? should be the exit status of the last pipeline (command substitution in the word list or command before 'for'), not always 0.
* sh: Remove "kill" example function, which is superseded by the kill builtinjilles2012-01-211-49/+0
| | | | MFC after: 1 week
* Remove unused variables.ed2012-01-171-96/+30
| | | | | Simply annotate the function parameters with __unused, instead of adding the ve-variables. This makes the code build with GCC 4.7 and -Werror.
* sh: Fix execution of multiple statements in a trap when evalskip is setdumbbell2012-01-163-2/+34
| | | | | | | | | | | Before this fix, only the first statement of the trap was executed if evalskip was set. This is for example the case when: o "-e" is set for this shell o a trap is set on EXIT o a function returns 1 and causes the script to abort Reviewed by: jilles MFC after: 2 weeks
* sh: Fix some bugs with exit status from case containing ;&.jilles2012-01-151-9/+24
| | | | | | | | | | | | | Also, rework evalcase() to not evaluate any tree. Instead, return the NCLISTFALLTHRU node and handle it in evaltree(). Fixed bugs: * If a ;& list with non-zero exit status is followed by an empty ;; or final list, the exit status of the case command should be equal to the exit status of the ;& list, not 0. * An empty ;& case should not reset $?.
* sh: Fix two bugs with case and exit status:jilles2012-01-151-1/+3
| | | | | | | * If no pattern is matched, POSIX says the exit status shall be 0 (even if there are command substitutions). * If a pattern is matched and there are no command substitutions, the first command should see the $? from before the case command, not always 0.
* sh: Change input buffer size from 1023 to 1024.jilles2012-01-141-6/+6
| | | | PR: bin/161756
* sh: Fix out of bounds array access when trap is used with an invalid signal.jilles2012-01-141-2/+2
| | | | MFC after: 1 week
* sh: Properly show "Not a directory" error in cd builtin.jilles2012-01-131-1/+6
| | | | | | | | The errno message display added in r222292 did not take attempting to cd to a non-directory or something that cannot be stat()ed into account. PR: bin/164070 MFC after: 10 days
* Spelling fixes for bin/uqs2012-01-071-1/+1
|
* sh: Make various functions static.jilles2012-01-0110-12/+12
|
* sh: Remove unused function scopyn().jilles2012-01-012-20/+0
|
* sh: Make patmatch() non-recursive.jilles2012-01-011-37/+58
|
* sh: Allow quoting ^ and ] in bracket expressions.jilles2011-12-281-4/+4
|
* sh: Use dirent.d_type in pathname generation.jilles2011-12-281-0/+4
| | | | | | This improves performance for globs where a slash or another component follows a component with metacharacters by eliminating unnecessary attempts to open directories that are not.
* sh: Cache de->d_namlen in a local variable.jilles2011-12-281-6/+8
|
* sh: Do not force special builtins non-special in optimized command subst.jilles2011-12-281-2/+1
| | | | | | | | | This is not necessary: errors are already caught in evalbackcmd() and forcelocal handles changes to variables. Note that this depends on r223024. MFC after: 4 weeks
* Fix some obtuse fprintf tricks in bin/ed.dim2011-12-162-18/+20
| | | | MFC after: 1 week
* Add static keywords to chio(1).ed2011-12-111-3/+3
| | | | | All other global variables are already marked static, so for consistency sake, add them to these three arrays as well.
* Move 3.5 KB from the data segment to the text segment.ed2011-12-111-5/+5
| | | | | The `struct modes' are only used by the getter-functions in the same file, so we can safely mark them static and const.
* sh: Remove impossible evalskip check in 'for'.jilles2011-11-271-3/+0
|
* sh: Reduce one level of evaltree() recursion when executing 'case'.jilles2011-11-261-11/+9
| | | | | | | Free expanded case text before executing commands. Remove impossible evalskip checks (expanding an argument cannot set evalskip anymore since $(break) and the like are properly executed in a subshell environment).
* test: Reduce code size of ops table.jilles2011-11-251-5/+5
|
* Remove yet another outdated note about procfs(5) being required.trociny2011-11-221-6/+0
| | | | Spotted by: arundel
* No need in procfs(5).trociny2011-11-222-25/+1
| | | | MFC after: 2 weeks
* sh: Allow unsetting OPTIND.jilles2011-11-201-2/+3
| | | | Note that only assigning the decimal value 1 resets getopts, as before.
* sh: Remove undefined behaviour due to overflow in +/-/* in arithmetic.jilles2011-11-081-3/+3
| | | | With i386 base gcc and i386 base clang, arith_yacc.o remains unchanged.
* sh(1): Improve documentation of field splitting.jilles2011-11-051-11/+55
|
* Put some static keywords in the source code.ed2011-10-316-23/+23
| | | | | | For these simple utilities, it doesn't harm to make all global variables static. In fact, this allows the compiler to perform better forms of optimisation and analysis.
* For processes with no controlling terminal, display "-" in the TTY columntrasz2011-10-302-4/+8
| | | | | | instead of "?". Submitted by: arundel
* If ls was invoked with -i but neither -l nor -s, blocksize was used indes2011-10-191-2/+2
| | | | | | | display() to calculate column widths, but was not initialized in main(). This resulted in a division by zero. Noticed by: Michael Butler <imb@protected-networks.net>
* When calculating the width of the blocksize column, ls(1) used 512-bytedes2011-10-181-2/+2
| | | | | | | units (as returned by stat(2)) instead of BLOCKSIZE units. Submitted by: Paul Schenkeveld MFC after: 3 weeks
* Minor clarificationdes2011-10-181-1/+2
| | | | MFC after: 3 weeks
* Simplify df(1) by factoring out most of the common code:des2011-10-181-26/+27
| | | | | | | | | | | | | | | | | | | | | - In the argc == 0 case, just populate the mount list as before, but do not calculate widths, update totals or print anything. - In the argv > 0 case, collect information about the requested file systems and store it in the mount list, but do not calculate widths, update totals or print anything. - In either case, once all the information has been collected, iterate once through the mount list to calculate widths and totals, then once more to print everything. This also fixes two bugs: firstly, column widths were not calculated correctly if more than one file system was specified on the command line; and secondly, file systems with MNT_IGNORE were included in the totals even if -a was not specified. Noticed by: Paul Schenkeveld MFC after: 3 weeks
OpenPOWER on IntegriCloud