nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nmh 1.8RC2, xlbiff, and $HOME


From: Robert Elz
Subject: Re: nmh 1.8RC2, xlbiff, and $HOME
Date: Wed, 01 Feb 2023 04:18:01 +0700

    Date:        Tue, 31 Jan 2023 13:22:19 +0000
    From:        Ralph Corderoy <ralph@inputplus.co.uk>
    Message-ID:  <20230131132219.5E02B20340@orac.inputplus.co.uk>

  | 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]