mirror of
https://github.com/git/git.git
synced 2026-03-14 02:43:25 +01:00
Scan for \r in addition to \n when reading shbang lines
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
This commit is contained in:
committed by
Steffen Prohaska
parent
f01c16a4bb
commit
3ad18f2446
@@ -448,8 +448,8 @@ static const char *parse_interpreter(const char *cmd)
|
||||
if (buf[0] != '#' || buf[1] != '!')
|
||||
return NULL;
|
||||
buf[n] = '\0';
|
||||
p = strchr(buf, '\n');
|
||||
if (!p)
|
||||
p = buf + strcspn(buf, "\r\n");
|
||||
if (!*p)
|
||||
return NULL;
|
||||
|
||||
*p = '\0';
|
||||
|
||||
Reference in New Issue
Block a user