gworek@codas.UUCP (11/13/87)
Description:
Remaining .mailrc commands are ignored if the user
attempts to "unset" a variable that has not
been previously set.
Versions Tested:
/usr/bin/mailx.sl 1.24 3.1 02/02/87 46435 AT&T-SF
/usr/bin/mailx.sl 1.13 3.0 02/19/86 63855 AT&T-SF
Repeat-by:
Add an "unset zot" command early in your ~/.mailrc.
A good location is before a list of aliases, or
before a list of "ignore" specifications.
Go into mail. At the "?" prompt type "alias" or
"ignore". All aliases, ignores, and other commands
after the "unset zot" command are not available and
have not been executed.
Discussion:
The bug was discovered when a .mailrc was moved to
a new system. The user's .mailrc contained an
"unset ignoreeof" command to override a "set ignoreeof"
command in /usr/lib/mailx/mailx.rc on another system.
The error is not serious, and the remainder of the
.mailrc should be read and executed.
Fix:
Change the "deassign()" function in the vars.c module
to return success when sourcing .mailrc and the variable
is not set.
*** vars.old Thu Nov 12 16:33:32 1987
--- vars.c Thu Nov 12 16:34:03 1987
***************
**** 56,61 ****
if ((vp2 = lookup(s)) == NOVAR) {
if (!sourcing) {
printf("\"%s\": undefined variable\n", s);
}
! return(1);
}
---- 56,62 ----
if ((vp2 = lookup(s)) == NOVAR) {
if (!sourcing) {
printf("\"%s\": undefined variable\n", s);
+ return(1);
}
! return(0);
}
--
Don Gworek
gworek@codas.att.com
AT&T: 305/869-2752