---

On Sat, Mar 1, 2008 Steffen Prohaska <[EMAIL PROTECTED]> wrote:
>
>  Hi,
>  I uploaded the installer Git-preview20080301.exe, which includes a
>  recent master of official Git, includes git svn, and has
>  core.autocrlf=true as its default.

I downloaded and installed this version of git, used it to clone
git://repo.or.cz/msysgit.git, rebuilt the installer, and wondered why
"git commit" was failing with errors about vi.

After some digging, it turns out that "vi" in msysgit.git is a shell
script, and git was trying to launch "sh\r" instead of "sh", since the
vi script was autocrlf'd.

This patch fixes the problem.

 compat/mingw.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/compat/mingw.c b/compat/mingw.c
index 32bb5f3..bf8d60d 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -424,8 +424,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';
-- 
1.5.3.7

Reply via email to