summaryrefslogtreecommitdiffstats
path: root/bin/sh
Commit message (Collapse)AuthorAgeFilesLines
* Install /bin/sh safely. This allows a shell script to be usedru2004-03-181-0/+1
| | | | | | | to strip binaries by specifying it in the STRIPBIN environment variable honoured by install(1). MFC after: 3 days
* style.Makefile:johan2004-02-231-1/+1
| | | | Use WARNS?= instead of WARNS=
* style(9): wrap at 80 columns.njl2004-02-121-3/+5
|
* Handle proper formatting and a buffer overrun when running an old sh onnjl2004-02-121-7/+28
| | | | | | | a system that has sys_nsig > NSIG (i.e. when libc is upgraded.) Submitted by: Matt Dillon Reviewed by: bde
* Fixed style of DPADD and LDADD assignments as per style.Makefile(5).ru2004-02-051-2/+2
|
* Commit fix sent by Tor Egge <Tor.Egge@cvsup.no.freebsd.org>cracauer2004-02-051-1/+1
| | | | | | | | | | Only use return value from system call if system call succeeded. Tested with `make world` and some of my own scripts. This should be MFCed soon. While /bin/sh is hard to test the fix is obviously correct and can be assumed not to break something else (famous last words...).
* Use sys_nsig instead of NSIG for the length of the signal arrays. Thisnjl2004-01-282-6/+6
| | | | | | | is important if we add new signals later. From DragonflyBSD: jobs.c:1.4, trap.c:1.3. Obtained from: DragonflyBSD
* The PR diff I committed recently had one bug noticed bycracauer2004-01-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | Joe Marcus Clarke <marcus@FreeBSD.ORG>, subshells could lose a non-zero exit status. This commit is Joe's proposed patch. Thanks! I verified that the problem Joe found is fixed and I ran a full world with this patch. I don't plan to ever commit language patches to /bin/sh again. It is a minefield too big to navigate without a full-time committment, which I am not willing to do on our /bin/sh. Under normal circumstances I would recommend using NetBSD's sh which has a lot of language fixes (like the ones what these patches were about) but unfortunately they had implemented broken signal behaviour for shellscript containing interactive programs. Similar issues apply to pdksh which is OpenBSD's sh. From my perspective bash2 is the only really working bourne sh out there and that one is GPLed. Oh well.
* Replace home-grown dup2() implementation with actual dup2() calls. Thisdes2004-01-215-43/+13
| | | | | | | should slightly reduce the number of system calls in critical portions of the shell, and select a more efficient path through the fdalloc code. Reviewed by: bde
* Removed duplicate y.tab.h from SRCS and CLEANFILES.ru2004-01-201-1/+1
|
* o Spell 'diretories' correctly.maxim2003-12-301-1/+1
| | | | | | PR: misc/60730 Submitted by: Eugene Grosbein MFC after: 3 days
* PR 28852cracauer2003-12-281-24/+1
| | | | | | | | | | | | | | | sh -e behaviour was incorrect when && and || statements where used in "if" clauses. This is the patch submitted by MORI Kouji <mori@tri.asanuma.co.jp>. It fixes the issue at hand, but sh fixes like this are super-hard to verify that they don't break anything else. I ran some of my old test cases and a few big GNU configure scripts that detected mistakes before, with the previous sh, patched sh and bash. No differences in behaviour found. MFC recommended after longer than usual time. Compiles on i386 and sledge.
* Do not assume there is only a space between #define and the macro nameschweikh2003-09-131-1/+1
| | | | | | | | when grepping for JOBS. The recent style cleanup replaced the space with a tab and broke job control detection. Little edits, disastrous consequences. Submitted by: Peter Edwards <pmedwards@eircom.net> X-MFC when: in about 5 weeks with the other sh arithmetic fixes.
* mdoc(7): Use the new feature of the .In macro.ru2003-09-081-1/+1
|
* Fix testing of arith_assign() value for $((a=15)).schweikh2003-09-071-1/+1
| | | | Submitted by: Enache Adrian <enache@rdslink.ro>
* #include <string.h> for prototypes for strcpy() and strlen().tjr2003-09-061-0/+2
| | | | Submitted by: Stefan Farfeleder
* Style cleanup, mostlyschweikh2003-09-044-207/+246
| | | | Requested by: bde
* Implement missing shell arithmetic operators in $(()) expansionschweikh2003-08-304-49/+236
| | | | | | | | | | and variable recognition. PR: standards/52972 Submitted by: Wartan Hachaturow <wart@tepkom.ru> Reviewed by: tjr (improved on original patch) Tested by: buildworld on CURRENT. MFC after: 6 weeks
* Remove collate_range_cmp() stabilization, it conflicts with rangesache2003-08-031-9/+2
|
* Changes following CScout analysis:dds2003-07-0513-38/+37
| | | | | | | | | | | - Removed dead declarations - Made objects that should have been declared as static, static. The changes use STATIC instead of static, following the existing convention in the rest of the code. Approved by: schweikh (mentor) MFC after: 2 weeks
* Instead of eating trailing newlines after inserting them into thefenner2003-05-311-5/+12
| | | | | | | | | | | | | output buffer, don't insert them at all. This prevents a buffer *underrun* when the substitution consists completely of newlines (e.g. `echo`) and the byte before the source buffer to which p points is a '\n', in which case more characters would be removed from the output buffer than were inserted. This fixes certain port builds on sparc64. Approved by: re (scottl) Reviewed by: des, tjr
* mdoc(7) police: A better version of the same.ru2003-05-161-2/+2
| | | | Approved by: re (blanket)
* Centralize _PATH_* definitions.obrien2003-05-051-1/+2
| | | | Submitted by: Tim Kientzle <kientzle@acm.org> (embellished by me)
* The is_name and is_in_name macros are FUBAR'ed.obrien2003-05-021-0/+2
| | | | | | Due to the use of signed vs. unsigned chars on our various platforms, one gets "warning: comparison is always true due to limited range of data type" from GCC 3.3.
* Quiet warnings about copyright[].obrien2003-05-014-8/+8
|
* Fix references to non-existing or obsoleted man pages.schweikh2003-04-301-2/+1
| | | | | PR: docs/51480 (only a small part) Submitted by: Diomidis D. Spinellis <dds@aueb.gr>
* Document the -L and -P options to the cd and pwd commands as beingtjr2003-04-121-3/+3
| | | | | | mutually exclusive. The fact that the most recent one specified on the command line is the one that takes effect is an implementation detail and users should not rely on this.
* Flush the output buffers before forking a child process to avoidtjr2003-03-171-0/+1
| | | | | | | the child process writing data that the parent should have written. PR: 50051 MFC after: 2 weeks
* Fixed (soon might be fatal) -Wformat warnings.ru2003-03-151-2/+3
|
* Third attempt at removing machdep.h and using ALIGN from <sys/param.h>.marcel2003-02-243-101/+54
| | | | | | | | | | | | | | The initial stack_block is staticly allocated and will be aligned according to the alignment requirements of pointers, which does not necessarily match the alignment enforced by ALIGN. To solve this a more involved change is required: remove the static initial stack and deal with an initial condition of not having a stack at all. This change is therefore more risky than the previous ones, but unavoidable (other than not using the platform default alignment). Discussed with: tjr Approved and reviewed by: tjr Tested on: alpha, i386, ia64 and sparc64
* Revert ALIGN change for the second and last time. I can't figure outtjr2003-02-183-6/+56
| | | | why this is breaking sparc64.
* Second attempt at removing machdep.h and using ALIGN from <sys/param.h>.tjr2003-02-173-56/+6
| | | | | | The problem with the previous attempt, as noticed by Marcel, was that stacknxt was being aligned to a pointer boundary instead of an ALIGNBYTES + 1 boundary, which broke sparc64.
* Temporarily back out machdep.h/ALIGN changes. It seems that on sparc64,tjr2003-02-163-4/+54
| | | | | | using the alignment from sys/param.h (16) instead of the alignment from machdep.h (8) tickled a nasty bug in the memory allocator that I haven't been able to track down yet.
* Use the ALIGN macro from <sys/param.h> instead of defining our owntjr2003-02-143-54/+4
| | | | incorrect version in machdep.h. Delete machdep.h.
* Add FBSDID.charnier2003-02-051-1/+3
|
* Improve the layout of the description of the various parameter expansionfanf2003-02-031-0/+2
| | | | | modifiers. The paragraph that explains the difference between ${foo:-bar} and ${foo-bar} etc. was not very visible.
* Ensure that the TTY file descriptor is greater than or equal to 10 so thattjr2003-01-271-1/+14
| | | | | | | it doesn't interfere with the user's redirections. PR: 47136 MFC after: 1 week
* Make this compile with DEBUG defined now that WARNS=0 has been removedtjr2003-01-213-2/+4
| | | | | | | | from the Makefile: - Print pointers with %p instead of %x. - Include missing headers to get prototypes. Noticed by: benno
* Do not strip CTL* escapes from redirection filenames in exptilde(),tjr2003-01-081-4/+4
| | | | | | | | expari(), expbackq() and evalvar(). Similar to revision 1.39. Patch from Tor Egge. PR: 45349 MFC after: 2 weeks
* Add the "wordexp" shell built-in command which will be used to implementtjr2002-12-263-0/+24
| | | | the POSIX wordexp() function.
* mdoc(7) police: Deal with self-xrefs.ru2002-12-241-1/+1
|
* mdoc(7) police: markup nit.ru2002-12-231-1/+1
|
* Use '\033' rather than '\e' as the latter is a gccism.dwmalone2002-12-221-1/+1
| | | | | | PR: 46015 Submitted by: Jeroen Ruigrok van der Werven <asmodai@wxs.nl> MFC after: 1 week
* The code uses trapsasync, however the manual page uses asynctraps. Fix thetrhodes2002-12-171-1/+1
| | | | | | | | manual page to reflect the code. PR: 45820 Submitted by: Marco Molteni <molter@tin.it> Discussed with: tjr
* Document `trap EXIT` and `trap SIGNAME`.fanf2002-12-171-1/+4
|
* When job control is disabled, never show the job id when reporting thetjr2002-12-141-1/+2
| | | | status of a background process that has terminated because of a signal.
* Capitalize ASCII code names.ru2002-12-051-1/+3
| | | | Approved by: re
* Delete worthless comments.tjr2002-10-301-5/+1
|
* Avoid accidentally making "-h" a synonym for "fc".tjr2002-10-181-1/+1
| | | | Obtained from: NetBSD
* Do not strip CTL* escapes from redirection filenames in argstr(); theytjr2002-10-081-1/+1
| | | | | | | | are later stripped with rmescapes() in expandarg(). If the filename has already been unescaped, doing it again in rmescapes() can walk off the end of the string, leading to memory corruption and eventually SIGSEGV. Noticed by: kris
OpenPOWER on IntegriCloud