From 03e00599acea10d2f8927b7d243ad95a0b680f3c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 5 Oct 2010 09:29:28 -0700 Subject: [PATCH] more ports to Solaris tr, which needs [] around ranges * gnulib-tool: Solaris tr needs [] around ranges. * m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Likewise. * tests/test-pipe-filter-gi1.c (main): Likewise. * tests/test-pipe-filter-ii1.c (main): Likewise. --- ChangeLog | 8 ++++++++ gnulib-tool | 6 +++--- m4/fnmatch.m4 | 4 +++- tests/test-pipe-filter-gi1.c | 8 ++++---- tests/test-pipe-filter-ii1.c | 8 ++++---- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index e37577afc6..6cf569a791 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-10-05 Paul Eggert + + more ports to Solaris tr, which needs [] around ranges + * gnulib-tool: Solaris tr needs [] around ranges. + * m4/fnmatch.m4 (gl_FUNC_FNMATCH_POSIX): Likewise. + * tests/test-pipe-filter-gi1.c (main): Likewise. + * tests/test-pipe-filter-ii1.c (main): Likewise. + 2010-10-05 Eric Blake bootstrap: fix Solaris regression diff --git a/gnulib-tool b/gnulib-tool index b89c2eb4a8..afd6493691 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -4584,7 +4584,7 @@ s,//*$,/,' # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is # created using libtool, because libtool already handles the dependencies. if test "$libtool" != true; then - libname_upper=`echo "$libname" | LC_ALL=C tr 'a-z-' 'A-Z_'` + libname_upper=`echo "$libname" | LC_ALL=C tr '[a-z]-' '[A-Z]_'` echo " ${libname_upper}_LIBDEPS=\"\$gl_libdeps\"" echo " AC_SUBST([${libname_upper}_LIBDEPS])" echo " ${libname_upper}_LTLIBDEPS=\"\$gl_ltlibdeps\"" @@ -5163,7 +5163,7 @@ func_create_testdir () # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is # created using libtool, because libtool already handles the dependencies. if test "$libtool" != true; then - libname_upper=`echo "$libname" | LC_ALL=C tr 'a-z-' 'A-Z_'` + libname_upper=`echo "$libname" | LC_ALL=C tr '[a-z]-' '[A-Z]_'` echo " ${libname_upper}_LIBDEPS=\"\$gl_libdeps\"" echo " AC_SUBST([${libname_upper}_LIBDEPS])" echo " ${libname_upper}_LTLIBDEPS=\"\$gl_ltlibdeps\"" @@ -5281,7 +5281,7 @@ func_create_testdir () # _LIBDEPS and _LTLIBDEPS variables are not needed if this library is # created using libtool, because libtool already handles the dependencies. if test "$libtool" != true; then - libname_upper=`echo "$libname" | LC_ALL=C tr 'a-z-' 'A-Z_'` + libname_upper=`echo "$libname" | LC_ALL=C tr '[a-z]-' '[A-Z]_'` echo " ${libname_upper}_LIBDEPS=\"\$gl_libdeps\"" echo " AC_SUBST([${libname_upper}_LIBDEPS])" echo " ${libname_upper}_LTLIBDEPS=\"\$gl_ltlibdeps\"" diff --git a/m4/fnmatch.m4 b/m4/fnmatch.m4 index 212ead5729..84bcabd9ff 100644 --- a/m4/fnmatch.m4 +++ b/m4/fnmatch.m4 @@ -20,7 +20,9 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX], AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) FNMATCH_H= - gl_fnmatch_required_lowercase=`echo $gl_fnmatch_required | tr 'A-Z' 'a-z'` + gl_fnmatch_required_lowercase=` + echo $gl_fnmatch_required | tr '[[A-Z]]' '[[a-z]]' + ` gl_fnmatch_cache_var="gl_cv_func_fnmatch_${gl_fnmatch_required_lowercase}" AC_CACHE_CHECK([for working $gl_fnmatch_required fnmatch], [$gl_fnmatch_cache_var], diff --git a/tests/test-pipe-filter-gi1.c b/tests/test-pipe-filter-gi1.c index 2305fa60a3..d35838eeae 100644 --- a/tests/test-pipe-filter-gi1.c +++ b/tests/test-pipe-filter-gi1.c @@ -26,8 +26,8 @@ #include "macros.h" -/* Pipe a text file through 'tr a-z A-Z', which converts ASCII characters from - lower case to upper case. */ +/* Pipe a text file through 'tr "[a-z]" "[A-Z]"', which converts ASCII + characters from lower case to upper case. */ struct locals { @@ -96,8 +96,8 @@ main (int argc, char *argv[]) l.nread = 0; argv[0] = tr_program; - argv[1] = "a-z"; - argv[2] = "A-Z"; + argv[1] = "[a-z]"; + argv[2] = "[A-Z]"; argv[3] = NULL; f = pipe_filter_gi_create ("tr", tr_program, argv, false, true, diff --git a/tests/test-pipe-filter-ii1.c b/tests/test-pipe-filter-ii1.c index 58cc1926c5..94de2f1520 100644 --- a/tests/test-pipe-filter-ii1.c +++ b/tests/test-pipe-filter-ii1.c @@ -26,8 +26,8 @@ #include "macros.h" -/* Pipe a text file through 'tr a-z A-Z', which converts ASCII characters from - lower case to upper case. */ +/* Pipe a text file through 'tr "[a-z]" "[A-Z]"', which converts ASCII + characters from lower case to upper case. */ struct locals { @@ -119,8 +119,8 @@ main (int argc, char *argv[]) l.nread = 0; argv[0] = tr_program; - argv[1] = "a-z"; - argv[2] = "A-Z"; + argv[1] = "[a-z]"; + argv[2] = "[A-Z]"; argv[3] = NULL; result = pipe_filter_ii_execute ("tr", tr_program, argv, false, true, -- 2.30.2