🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by David Trueman Mon, 16 Apr 1984 22:44
fix for Bourne shell export or readonly without arguments
#134
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads