mirror of
https://github.com/git/git.git
synced 2024-11-27 20:14:30 +08:00
MinGW: Scan for \r in addition to \n when reading shbang lines
\r is common on Windows, so we should handle it gracefully. Signed-off-by: Steffen Prohaska <prohaska@zib.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
7f5a68ad4d
commit
bedc4279a8
@ -525,8 +525,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';
|
||||
|
Loading…
Reference in New Issue
Block a user