summaryrefslogtreecommitdiffstats
path: root/bin/sh/exec.c
Commit message (Collapse)AuthorAgeFilesLines
* Use eaccess() instead of access() for the type builtin, like we do for thestefanf2007-01-181-1/+1
| | | | | | test builtin. Submitted by: Martin Kammerhofer
* Return an error status (127) from the builtins 'type' and 'command' (withstefanf2007-01-111-2/+5
| | | | | | | | | | either -v or -V) if a file with a slash in the name doesn't exist (if there is no slash we already did that). Additionally, suppress the error message for command -v for files with a slash. PR: 107674 Submitted by: Martin Kammerhofer
* Implement some of the differences between special built-ins and other builtinsstefanf2006-04-091-4/+11
| | | | | | | | | | | | | | | | | | | | demanded by POSIX. - A redirection error is only fatal (meaning the execution of a shell script is terminated) for special built-ins. Previously it was fatal for all shell builtins, causing problems like the one reported in PR 88845. - Variable assignments remain in effect for special built-ins. - Option or operand errors are only fatal for special built-ins. This change also makes errors from 'fc' non-fatal (I could not find any reasons for this behaviour). Somewhat independently from the above down-grade the error handling in the shift built-in if the operand is bigger than $# from an error() call (which is now fatal) to a return 1. I'm not sure if this should be considered a POSIX "operand error", however this change is needed for now as we trigger that error while building libncurses. Comparing with other shells, zsh does the same as our sh before this change (write a diagnostic, return 1), bash behaves as our sh after this commit (no diagnostic, return 1) and ksh93 and NetBSD's sh treat it as a fatal error.
* Add the POSIX options -v and -V to the 'command' builtin. Both describe thestefanf2005-10-281-12/+47
| | | | | | | type of their argument, if it is a shell function, an alias, a builtin, etc. -V is more verbose than -v. PR: 77259, 84539
* Use prototypes in the MKINIT lines collected by mkinit.stefanf2005-08-131-1/+1
|
* Attempting to unset an undefined variable or function should not bedes2004-09-271-1/+1
| | | | | | | | considered an error according to the Open Group Base Specification. PR: standards/45738 Submitted by: Matthias Andree <matthias.andree@web.de> MFC after: 3 days
* Remove clause 3 from the UCB licenses.markm2004-04-061-4/+0
| | | | OK'ed by: imp, core
* Changes following CScout analysis:dds2003-07-051-1/+1
| | | | | | | | | | | - 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
* Restore "not found" error message when searching for (or executing)tjr2002-10-011-2/+8
| | | | | | a program fails because the file or a path component does not exist. Suggested by: bde
* Convert the remaining callers of errmsg() to use strerror(), and removetjr2002-09-291-2/+2
| | | | errmsg() and its table of error messages.
* Remove broken and incomplete support for old releases of System V,tjr2002-07-191-104/+1
| | | | don't support system that implement getcwd(3) with a pipe to /bin/pwd.
* Consistently use FBSDIDobrien2002-06-301-2/+2
|
* Don't list shell builtins when the hash command is used (SUSv3)tjr2002-06-131-1/+2
|
* Stop a null pointer dereference in the builtin hash function.greid2002-04-151-1/+4
| | | | | | PR: 36141 Approved by: cracauer MFC after: 1 week
* o __P has been reovedimp2002-02-021-78/+33
| | | | | | | | | | | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. o Change int foo() { ... to int foo(void) { ...
* Fix type builtin for absolute paths and relative paths with directorycracauer2000-08-161-9/+16
| | | | | | | | | names in them. Also use a colon in the answer of `type` everytime the questioned item is not usable. PR: bin/20567
* Fix command hash handling oncracauer1999-12-201-2/+1
| | | | | | PATH=... command Noted by and fix works for Marcel Moolenaar <marcel@scc.nl>
* $Id$ -> $FreeBSD$peter1999-08-271-1/+1
|
* Add rcsid. Spelling.charnier1998-05-181-3/+5
|
* Use the __unused attribute where warranted.steve1997-05-191-3/+3
|
* Add a type builtin and nuke register keyword usage.steve1997-04-281-4/+79
| | | | Obtained from: NetBSD
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Merge in NetBSD mods and -Wall cleaning.steve1996-12-141-6/+22
| | | | Obtained from: NetBSD, me
* Fix for PR#1287. This makes sh behave sensibly in case statements in thepeter1996-09-031-2/+2
| | | | | | | | | | | | | | face of aliases. Note, bash doesn't do aliases while running scripts, but "real" ksh does.. Also: Reduce redundant .Nm macros in (unused) bltin/echo.1 nuke error2, it's hardly used. More -Wall cleanups dont do certain history operations if NO_HISTORY defined handle quad_t's from resource limits Submitted by: Steve Price <sprice@hiwaay.net> (minor tweaks by me)
* Merge of 4.4-Lite2 sh source, plus some gcc -Wall cleaning. This is apeter1996-09-011-41/+48
| | | | | | | | | | | | | | merge of parallel duplicate work by Steve Price and myself. :-] There are some changes to the build that are my fault... mkinit.c was trying (poorly) to duplicate some of the work that make(1) is designed to do. The Makefile hackery is my fault too, the depend list was incomplete because of some explicit OBJS+= entries, so mkdep wasn't picking up their source file #includes. This closes a pile of /bin/sh PR's, but not all of them.. Submitted by: Steve Price <steve@bonsai.hiwaay.net>, peter
* Remove trailing whitespace.rgrimes1995-05-301-2/+2
| | | | Reviewed by: phk
* Added $Id$dg1994-09-241-0/+2
|
* Got rid of stupid warning message.dg1994-08-181-11/+1
|
* BSD 4.4 Lite bin Sourcesrgrimes1994-05-261-0/+828
OpenPOWER on IntegriCloud