summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f5a68a)
raw | patch | inline | side by side (parent: 7f5a68a)
author | Peter Harris <git@peter.is-a-geek.org> | |
Sat, 23 May 2009 08:04:47 +0000 (10:04 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 23 May 2009 08:54:45 +0000 (01:54 -0700) |
\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>
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c | patch | blob | history |
diff --git a/compat/mingw.c b/compat/mingw.c
index cdeda1d9859fd545950e0c39ee7de3c9dc09bb07..b723c4dfd63ef3021e47419bd2dbe570b8ec7b11 100644 (file)
--- a/compat/mingw.c
+++ b/compat/mingw.c
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';