From: Johannes Sixt Date: Thu, 24 Jul 2008 06:50:16 GMT Subject: Re: [PATCH] Preserve cwd in setup_git_directory() Message-ID: <48882628.7030305@viscovery.net> In-Reply-To: <20080724031441.GA26072@laptop> Nguyễn Thái Ngọc Duy schrieb: > --- 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