From: Junio C Hamano <gitster@pobox.com>
To: "Nguyễn Thái Ngọc" <pclouds@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
Jonathan Niedier <jrnieder@gmail.com>,
David Turner <dturner@twopensource.com>
Subject: Re: [PATCH] Fix "t0001: test git init when run via an alias"
Date: Tue, 10 Jun 2014 12:09:59 -0700 [thread overview]
Message-ID: <CAPc5daW-1SbppkQicew4a60pQv-cfGXTim8zPrUBxvJ7MVXQcw@mail.gmail.com> (raw)
In-Reply-To: <xmqqzjhk8ukk.fsf@gitster.dls.corp.google.com>
Oops; obviously the check must be for NULL-ness, i.e.
if (!getcwd(...))
die_errno(...);
On Tue, Jun 10, 2014 at 11:53 AM, Junio C Hamano <gitster@pobox.com> wrote:
> I'd squash this in, though.
>
> git.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/git.c b/git.c
> index 6bb2043..9bfa8fb 100644
> --- a/git.c
> +++ b/git.c
> @@ -36,7 +36,8 @@ static void save_env(void)
> if (saved_environment)
> return;
> saved_environment = 1;
> - getcwd(orig_cwd, sizeof(orig_cwd));
> + if (getcwd(orig_cwd, sizeof(orig_cwd)))
> + die_errno("cannot getcwd");
> for (i = 0; i < ARRAY_SIZE(env_names); i++) {
> orig_env[i] = getenv(env_names[i]);
> if (orig_env[i])
prev parent reply other threads:[~2014-06-10 19:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-05 3:49 Git autocorrect bug David Turner
2014-06-05 6:06 ` Øystein Walle
2014-06-05 6:10 ` Øystein Walle
2014-06-05 6:29 ` Duy Nguyen
2014-06-05 8:28 ` David Turner
2014-06-06 11:09 ` Duy Nguyen
2014-06-08 9:37 ` [PATCH] Fix "t0001: test git init when run via an alias" Nguyễn Thái Ngọc Duy
2014-06-10 18:48 ` Junio C Hamano
2014-06-11 10:57 ` Duy Nguyen
2014-06-12 17:11 ` Junio C Hamano
2014-06-10 18:53 ` Junio C Hamano
2014-06-10 19:09 ` Junio C Hamano [this message]
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=CAPc5daW-1SbppkQicew4a60pQv-cfGXTim8zPrUBxvJ7MVXQcw@mail.gmail.com \
--to=gitster@pobox.com \
--cc=dturner@twopensource.com \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=pclouds@gmail.com \
/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).