summaryrefslogtreecommitdiffstats
path: root/bin/sh/input.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-02-04 22:47:55 +0000
committerjilles <jilles@FreeBSD.org>2011-02-04 22:47:55 +0000
commit95ad413d4a493285a5560182fb10217819d7c357 (patch)
tree88fab75180accb5d4fe09924cbd01e047b9e4903 /bin/sh/input.c
parent88f7b7c78b4285a838792e26cf3806ab40f879d2 (diff)
downloadFreeBSD-src-95ad413d4a493285a5560182fb10217819d7c357.zip
FreeBSD-src-95ad413d4a493285a5560182fb10217819d7c357.tar.gz
sh: Remove special code for shell scripts without magic number.
These are called "shell procedures" in the source. If execve() failed with [ENOEXEC], the shell would reinitialize itself and execute the program as a script. This requires a fair amount of code which is not frequently used (most scripts have a #! magic number). Therefore just execute a new instance of sh (_PATH_BSHELL) to run the script.
Diffstat (limited to 'bin/sh/input.c')
-rw-r--r--bin/sh/input.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/bin/sh/input.c b/bin/sh/input.c
index 21a9134..e7baed3 100644
--- a/bin/sh/input.c
+++ b/bin/sh/input.c
@@ -119,12 +119,7 @@ INIT {
RESET {
popallfiles();
- if (exception != EXSHELLPROC)
- parselleft = parsenleft = 0; /* clear input buffer */
-}
-
-SHELLPROC {
- popallfiles();
+ parselleft = parsenleft = 0; /* clear input buffer */
}
#endif
OpenPOWER on IntegriCloud