🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.sys5
Article #644

mailx(1) unset bug

#644
From: gworek
Date: Thu, 12 Nov 1987 21:59
56 lines
1943 bytes
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
Technical Details
Message-ID: <1357@codas.att.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!codas!gworek

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!codas!gworek
From: gworek@codas.UUCP
Newsgroups: comp.bugs.sys5
Subject: mailx(1) unset bug
Message-ID: <1357@codas.att.com>
Date: Thu, 12-Nov-87 16:59:04 EST
Article-I.D.: codas.1357
Posted: Thu Nov 12 16:59:04 1987
Date-Received: Sat, 14-Nov-87 11:44:42 EST
Organization: AT&T, Altamonte Springs, FL
Lines: 56