From: Ævar Arnfjörð Bjarmason Date: Mon, 26 Jul 2010 16:35:56 GMT Subject: Re: [PATCH] config --get --path: check for unset $HOME Message-ID: In-Reply-To: <20100726150651.GA4021@burratino> On Mon, Jul 26, 2010 at 15:06, Jonathan Nieder wrote: >                size_t username_len = first_slash - username; >                if (username_len == 0) { >                        const char *home = getenv("HOME"); > +                       if (!home) > +                               goto return_null; >                        strbuf_add(&user_path, home, strlen(home)); >                } else { >                        struct passwd *pw = getpw_str(username, username_len); Should we maybe fall back on checking pw_dir in getpwuid() if $HOME isn't set?