зеркало из https://github.com/microsoft/git.git
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:
Родитель
7f5a68ad4d
Коммит
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';
|
||||
|
|
Загрузка…
Ссылка в новой задаче