The file README-ATTACHMENTS was removed - it has been moved to the docs
subdirectory. I thought that this had already been done but I guess not.
It's unrelated to the rest of these changes.
The remainder of these changes affect the way that nmh is installed. Nmh
has historically prompted the user for installation when any nmh command
is invoked if it doesn't think that it's installed. This is a problem for
programs that want to, for example, interact with nmh programs via pipes.
These changes alter this behavior. Now, when an nmh program thinks that
nmh isn't installed, it tells the user to run install-mh to install it.
A -check option has been added to install-mh that allows the existence of
an installation to be silently checked and indicated via the exit status.
The bulk of this change is in sbr/read_context.c. In the process of making
these changes, I noticed a fair amount of useless code that I removed. In
particular:
1. The program started with a test for whether or not defpath had already
been set. This could only happen if context_read() was called more
than once, which it isn't. This check also existed and was removed
from the following places:
sbr/context_del.c
sbr/context_find.c
sbr/context_replace.c
sbr/seq_read.c
sbr/seq_save.c
uip/flist.c
uip/folder.c
uip/rmf.c
2. A similar test for mypath was removed. No need to test it since it
doesn't happen. I'm just not a believer that
a = 1;
if (a != 1)
error();
is a good way to write code!
3. I removed the code makes a copy of the $HOME environment variable as
returned by getenv(). It's never changed, so it doesn't need copying.
4. I removed code that copied the pw_dir member of the passwd structure
returned by getpwuid() if $HOME isn't set. Yes, the returned structure
is static, but since the function is never called again the returned
values stay valid and don't need copying.
5. I removed the test for a NULL pw_dir member in the passwd structure
returned by getpwuid() since that never happens.
6. I removed code that removed a trailing / from mypath if mypath is more
than one character long. Unnecessary as // is interpreted as / anyway.
mypath never shows up in an error message, so nobody will ever see it.
Besides, this code didn't handle the case of multiple trailing slashes.
7. I removed code that replaced the MH environment variable contents with
an absolute path if it was a relative one. I'm a bit nervous about this
one, only testing will tell. Any nmh program that's invoked will use
the same context_read() code to convert a relative path to an absolute
one anyway. And there's no guarantee (or discussion) of this feature
in any of the documentation.
8. Althout context_read() tested the MH environment variable, install-mh
didn't. This means that the behavior was not consistent between
install-mh and all other nmh programs. I changed install-mh to be
consistent with context_read().
9. install-mh has been installed in the lib directory, not bin. So a
user would be unlikely to find it when prompted to run it. The
installation has been changed to add a link from bin to lib.
14 files changed: