mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 19:08:58 +00:00
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
This commit is contained in:
parent
c11e75cfcf
commit
30de91e8b8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=57226
@ -76,7 +76,7 @@ exec_shell_imgact(imgp)
|
|||||||
/*
|
/*
|
||||||
* Find end of line; return if the line > MAXSHELLCMDLEN long.
|
* 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])
|
if (ihp >= &image_header[MAXSHELLCMDLEN])
|
||||||
return(ENOEXEC);
|
return(ENOEXEC);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user