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: 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 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