Date: Tue, 31 Jan 2023 13:22:19 +0000
From: Ralph Corderoy <[email protected]>
Message-ID: <[email protected]>
| It looks to me like code assumes mypath isn't NULL, e.g. exmaildir(),
| so not bothering to call set_mypath() if MH is set doesn't look a goer.
Perhape not, but
void
set_mypath(void)
{
char *var = getenv("HOME");
if (var && *var != '\0') {
mypath = mh_xstrdup(var);
return;
}
errno = 0;
struct passwd *pw = getpwuid(getuid());
/* etc */
would be a fairly trivial change (making the function smaller).
It would also be possible to change
if (!*pw->pw_dir)
die("password entry has empty home directory");
to
if (*pw->pw_dir == '\0')
pw->pw_dir = "/"; /* or "/tmp" or even
"/no/home/dir" or ... */
if that seemed desirable,
kre