Re: [PATCH] Preserve cwd in setup_git_directory()
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Jul 24, 2008, 06:50 UTC
- Message-ID
- <48882628.7030305@viscovery.net>
- In-Reply-To
- <20080724031441.GA26072@laptop>
Nguyễn Thái Ngọc Duy schrieb:
Show 9 quoted lines
> --- a/setup.c
> +++ b/setup.c
> @@ -577,10 +577,14 @@ const char *setup_git_directory(void)
> /* If the work tree is not the default one, recompute prefix */
> if (inside_work_tree < 0) {
> static char buffer[PATH_MAX + 1];
> + static char cwd[PATH_MAX + 1];
> char *rel;
> + getcwd(cwd, PATH_MAX);This needs an error check.
-- Hannes