Error when starting git gui from command line

268 views
Skip to first unread message

Tale

unread,
Jul 5, 2012, 7:42:49 AM7/5/12
to msysGit
Hi,

When I try to start the Git GUI from the command line in Git-1.7.11-
preview20120704 I get a message box with the following error:

Error in startup script
couldn't read file "<insert random characters here>": no such file or
directory

This is caused by a typo in the new git-wrapper, so I propose the
following patch:

-- >8 --
Subject: [PATCH] Fix starting git-gui through git-wrapper.

Starting git-gui from the command line would result in an error,
because the
internal script variable was not initialized.

Signed-off-by: Theo Niessink <nies...@martinic.com>
---
src/git-wrapper/git-wrapper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/git-wrapper/git-wrapper.c b/src/git-wrapper/git-
wrapper.c
index bae6dcb..0618442 100644
--- a/src/git-wrapper/git-wrapper.c
+++ b/src/git-wrapper/git-wrapper.c
@@ -104,7 +104,7 @@ int main(void)
} else {
WCHAR script[MAX_PATH];
gui = 1;
- wcscat(script, exepath);
+ wcscpy(script, exepath);
PathAppend(script, L"libexec\\git-core\\git-gui");
PathQuoteSpaces(script);
wcscpy(cmd, L"wish.exe ");
--
1.7.11.msysgit.1

Erik Faye-Lund

unread,
Jul 5, 2012, 7:49:18 AM7/5/12
to Tale, msysGit
On Thu, Jul 5, 2012 at 1:42 PM, Tale <tal...@gmail.com> wrote:
> Subject: [PATCH] Fix starting git-gui through git-wrapper.
>
> Starting git-gui from the command line would result in an error,
> because the
> internal script variable was not initialized.
>
> Signed-off-by: Theo Niessink <nies...@martinic.com>
> ---
> src/git-wrapper/git-wrapper.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/git-wrapper/git-wrapper.c b/src/git-wrapper/git-
> wrapper.c
> index bae6dcb..0618442 100644
> --- a/src/git-wrapper/git-wrapper.c
> +++ b/src/git-wrapper/git-wrapper.c
> @@ -104,7 +104,7 @@ int main(void)
> } else {
> WCHAR script[MAX_PATH];
> gui = 1;
> - wcscat(script, exepath);
> + wcscpy(script, exepath);
> PathAppend(script, L"libexec\\git-core\\git-gui");
> PathQuoteSpaces(script);
> wcscpy(cmd, L"wish.exe ");

Yes, this looks obviously correct to me.

Pat Thoyts

unread,
Jul 5, 2012, 3:37:18 PM7/5/12
to kusm...@gmail.com, Tale, msysGit
Thanks - applied. Better do another release exe I guess.
Reply all
Reply to author
Forward
0 new messages