git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Steffen Prohaska <prohaska@zib.de>
Cc: Peter Karlsson <peter@softwolves.pp.se>,
	Git Mailing List <git@vger.kernel.org>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: Merge problems with git-mingw
Date: Tue, 09 Oct 2007 19:03:07 +0200	[thread overview]
Message-ID: <470BB44B.3030500@viscovery.net> (raw)
In-Reply-To: <BA71DD45-9226-4661-9C92-60EEEA8638D0@zib.de>

Steffen Prohaska schrieb:
> 
> On Oct 9, 2007, at 11:03 AM, Johannes Sixt wrote:
> 
>> Peter Karlsson schrieb:
>>> C:\Program Files\Git\bin>git var -l
>>> usage: git-var [-l | <variable>]
>>> C:\Program Files\Git\bin>git-var -l
>>> fatal: Not a git repository
>>> C:\Program Files\Git\bin>git --version
>>> git version 1.5.3.mingw.1
>>
>> For the time being, install this beast in a path without blanks.
>>
>> This needs fixing, appearently. :(
> 
> I have the printf 'callstack' below from the v1.5.3.mingw.1 version 
> (9c792c5)
> Apparently spawnve, which is called in compat/mingw.c, corrupts argv.

Thank you. Here is a quick-fix.

-- Hannes

diff --git a/compat/mingw.c b/compat/mingw.c
index 8bb0dba..361216f 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -303,7 +303,7 @@ void openlog(const char *ident, int option,
  {
  }

-static const char *quote_arg(const char *arg)
+const char *quote_arg(const char *arg)
  {
  	/* count chars to quote */
  	int len = 0, n = 0;
diff --git a/exec_cmd.c b/exec_cmd.c
index bad4843..7ab5a0f 100644
--- a/exec_cmd.c
+++ b/exec_cmd.c
@@ -129,7 +129,8 @@ int execv_git_cmd(const char **argv)
  		 */

  		tmp = argv[0];
-		argv[0] = git_command;
+		extern const char *quote_arg(const char *arg);
+		argv[0] = quote_arg(git_command);

  		trace_argv_printf(argv, -1, "trace: exec:");

  reply	other threads:[~2007-10-09 17:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-08 11:06 Merge problems with git-mingw Peter Karlsson
2007-10-08 12:00 ` Lars Hjemli
2007-10-08 12:33   ` Peter Karlsson
2007-10-08 13:10     ` Lars Hjemli
2007-10-08 14:56       ` Peter Karlsson
2007-10-08 19:59         ` Lars Hjemli
2007-10-09  6:10           ` Johannes Sixt
2007-10-09  7:06           ` Peter Karlsson
2007-10-09  7:36             ` Johannes Sixt
2007-10-09  8:56               ` Peter Karlsson
2007-10-09  9:03                 ` Johannes Sixt
2007-10-09 16:33                   ` Steffen Prohaska
2007-10-09 17:03                     ` Johannes Sixt [this message]
2007-10-09 18:09                       ` Linus Torvalds
2007-10-09 21:39                       ` [PATCH] exec_git_cmd: fix executing commands if path contains spaces Steffen Prohaska
2007-10-10  6:16                         ` Johannes Sixt
2007-10-10  7:00                           ` [PATCH] Fix invocation of external git commands with arguments with spaces Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=470BB44B.3030500@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=peter@softwolves.pp.se \
    --cc=prohaska@zib.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).