[m-rev.] trivial diff: fix portability bug in print_extra_inits

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Aug 8 19:11:16 AEST 2003


Estimated hours taken: 0.25
Branches: main

library/print_extra_inits:
	Fix a shell portability problem: use
		for file in "$@"; do ...
	rather than
		for file; do ...

	(Note that it is safe to use "$@" rather than "${1+$@}" here,
	since we are guaranteed that there will be at least one argument.)

Workspace: /home/mars/fjh/ws4/mercury
Index: library/print_extra_inits
===================================================================
RCS file: /home/mercury1/repository/mercury/library/print_extra_inits,v
retrieving revision 1.1
diff -u -d -r1.1 print_extra_inits
--- library/print_extra_inits	6 Aug 2003 12:38:14 -0000	1.1
+++ library/print_extra_inits	8 Aug 2003 09:07:18 -0000
@@ -13,7 +13,7 @@
 #
 #-----------------------------------------------------------------------------#
 
-for file; do
+for file in "$@"; do
 	if [ -f $file ]; then
 		grep '^INIT ' $file
 	else

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list