🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.bugs.v7
Article #134

fix for Bourne shell export or readonly without arguments

#134
From: David Trueman
Date: Mon, 16 Apr 1984 22:44
36 lines
1485 bytes
In System 5 manual page for the shell (sh(1)), the BUGS section
mentions that readonly without arguments produces the same output
as export without arguments.  I'm not sure why no one fixed this
before (the bug is also in V7 and 4.1bsd), because the fix is
quite simple. 

In the file name.c , in the function "printflg", change:

	IF n->namflg&N_EXPORT
	THEN	prs(export); blank();
	FI
	IF n->namflg&N_RDONLY
	THEN	prs(readonly); blank();
	FI
	IF n->namflg&(N_EXPORT|N_RDONLY)
	THEN	prs(n->namid); newline();
	FI

to:

	/* exitval is set in xec.c to N_EXPORT or N_RDONLY */
	IF exitval&n->namflg&N_EXPORT
	THEN	prs(export); blank();
	FI
	IF exitval&n->namflg&N_RDONLY
	THEN	prs(readonly); blank();
	FI
	IF n->namflg&exitval
	THEN	prs(n->namid); newline();
	FI

With these changes, readonly lists only those variables that *are*
readonly and likewise for export.
-- 
				David Trueman @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!david
Technical Details
Message-ID: <3757@utzoo.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!david

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!david
From: david@utzoo.UUCP (David Trueman)
Newsgroups: net.bugs.v7,net.bugs.usg
Subject: fix for Bourne shell export or readonly without arguments 
Message-ID: <3757@utzoo.UUCP>
Date: Mon, 16-Apr-84 17:44:27 EST
Article-I.D.: utzoo.3757
Posted: Mon Apr 16 17:44:27 1984
Date-Received: Mon, 16-Apr-84 17:44:27 EST
Organization: U of Toronto Zoology
Lines: 36