Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorPeter Harris <git@peter.is-a-geek.org>2009-05-23 12:04:47 +0400
committerJunio C Hamano <gitster@pobox.com>2009-05-23 12:54:45 +0400
commitbedc4279a833dc7f17ea7d1730d9f3e4ff018729 (patch)
tree0d2712e0459a6997643674b9dee482245e2ec9dc /compat
parent7f5a68ad4d0e00eb2f28405946ec0f2691d7ad81 (diff)
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>
Diffstat (limited to 'compat')
-rw-r--r--compat/mingw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index cdeda1d985..b723c4dfd6 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -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';