Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Adjust PATH so that it works in msysGit
Browse files Browse the repository at this point in the history
In msysGit, wish is in /mingw/bin.  So adjust the PATH and call wish
without a path.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Dec 18, 2007
1 parent f39faca commit 17fb03c
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,24 @@ static char * convert_directory_format(const char * path)
return converted;
}

static void adjust_path_for_git(const char *msys_path)
{
static int initialized = 0;

if (!initialized) {
const char *old_path = getenv("PATH");
int old_len = strlen(old_path);
int msys_path_len = strlen(msys_path);
char *new_path = malloc(old_len + 2 * msys_path_len + 23);
if (!new_path)
return;
sprintf(new_path, "PATH=%s\\bin;%s\\mingw\\bin;%s",
old_path, msys_path, msys_path);
putenv(new_path);
initialized = 1;
}
}

static STDMETHODIMP invoke_command(void *p,
LPCMINVOKECOMMANDINFO info)
{
Expand All @@ -99,9 +117,10 @@ static STDMETHODIMP invoke_command(void *p,
if (msysPath)
{
TCHAR command[1024];

wsprintf(command, TEXT("%s\\bin\\wish.exe \"%s/bin/git-gui\""),
msysPath, msysPath);

adjust_path_for_git(msysPath);
wsprintf(command, TEXT("wish.exe \"%s/bin/git-gui\""),
msysPath);


const char *wd = this_->name;
Expand Down

0 comments on commit 17fb03c

Please sign in to comment.