summaryrefslogtreecommitdiffstats
path: root/sys/kern/imgact_shell.c
diff options
context:
space:
mode:
authorcracauer <cracauer@FreeBSD.org>2000-02-15 08:49:57 +0000
committercracauer <cracauer@FreeBSD.org>2000-02-15 08:49:57 +0000
commit780f308962d5980b13a045ad4b988f98c70059c2 (patch)
treea9316030fc5eeb5679f9bea81915fed2d8c14d05 /sys/kern/imgact_shell.c
parentb0d269b71d121239ecda503ecdd1635cb4b85b55 (diff)
downloadFreeBSD-src-780f308962d5980b13a045ad4b988f98c70059c2.zip
FreeBSD-src-780f308962d5980b13a045ad4b988f98c70059c2.tar.gz
Allow comments in interpreter specification lines as in
#! /bin/sh # -*- perl -*- This is simply "delete everything after the next '#', not counting the first char in the line". No effort has been made to allow quoting, backslash escaping or '#' in interpreter names. The complies to POSIX 1003.2 in that Posix says the implementation is free to choose whatever it likes. PR: bin/16393
Diffstat (limited to 'sys/kern/imgact_shell.c')
-rw-r--r--sys/kern/imgact_shell.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/imgact_shell.c b/sys/kern/imgact_shell.c
index 38bab6b..78479da 100644
--- a/sys/kern/imgact_shell.c
+++ b/sys/kern/imgact_shell.c
@@ -76,7 +76,7 @@ exec_shell_imgact(imgp)
/*
* Find end of line; return if the line > MAXSHELLCMDLEN long.
*/
- for (ihp = &image_header[2]; *ihp != '\n'; ++ihp) {
+ for (ihp = &image_header[2]; *ihp != '\n' && *ihp != '#'; ++ihp) {
if (ihp >= &image_header[MAXSHELLCMDLEN])
return(ENOEXEC);
}
OpenPOWER on IntegriCloud