[m-rev.] diff: fix tr portability bug

Simon Taylor stayl at cs.mu.OZ.AU
Tue May 7 21:08:28 AEST 2002


On 07-May-2002, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> On 07-May-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > Estimated hours taken: 0.75
> > Branches: main
> > 
> > configure.in:
> > 	Change "tr a-z A-Z" to "tr '[a-z]' '[A-Z]'".  The former is
> > 	Posix-conforming, but doesn't work on some non-Posix-conforming
> > 	systems, in particular Solaris.  The latter works on both Solaris
> > 	and on Posix-conforming systems.
> 
> It might be better to spell it out:
> `tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
> For example /usr/xpg4/bin/tr on taifun doesn't support
> character ranges properly.

I've committed the following change.

Simon.


Estimated hours taken: 0.5 (+0.75 by fjh)
Branches: main

Fix a bug reported and tracked down by Michael Day <mikeday at bigpond.net.au>.

configure.in:
	Change "tr a-z A-Z" to
	"tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ".
	The former is Posix-conforming, but doesn't work on some
	non-Posix-conforming systems, in particular Solaris.
	The latter works on both Solaris and on Posix-conforming systems.

Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.304
diff -u -u -r1.304 configure.in
--- configure.in	2002/05/03 05:07:07	1.304
+++ configure.in	2002/05/07 07:55:11
@@ -432,7 +432,8 @@
 
     for mercury_cv_func in "$@"
     do
-	mercury_cv_func_define=MR_HAVE_`echo $mercury_cv_func | tr a-z A-Z`
+	mercury_cv_func_define="MR_HAVE_`echo $mercury_cv_func | \
+		tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`"
 	AC_CHECK_FUNC($mercury_cv_func, [
 		AC_DEFINE_UNQUOTED($mercury_cv_func_define)
 	])
@@ -461,7 +462,7 @@
     for mercury_cv_header in "$@"
     do
 	mercury_cv_header_define="MR_HAVE_`echo $mercury_cv_header | \
-						tr 'a-z./' 'A-Z__'`"
+		tr abcdefghijklmnopqrstuvwxyz./ ABCDEFGHIJKLMNOPQRSTUVWXYZ__`"
 	AC_CHECK_HEADER($mercury_cv_header, [
 		AC_DEFINE_UNQUOTED($mercury_cv_header_define)
 		eval "$mercury_cv_header_define=1"
--------------------------------------------------------------------------
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