Quote result of m4_toupper and m4_tolower.

* lib/m4sugar/m4sugar.m4 (m4_tolower, m4_toupper): Quote result.
* lib/autotest/general.m4 (AT_KEYWORDS): Adjust caller.
* tests/m4sugar.at (m4@&t@_toupper and m4@&t@_tolower): New test.
* NEWS: Document this.
* THANKS: Update.
Reported by Sam Steingold.

Signed-off-by: Eric Blake <ebb9@byu.net>
This commit is contained in:
Eric Blake 2009-09-14 06:58:51 -06:00
parent ceff70a258
commit 6b22fb3155
6 changed files with 57 additions and 6 deletions

View File

@ -1,3 +1,13 @@
2009-09-14 Eric Blake <ebb9@byu.net>
Quote result of m4_toupper and m4_tolower.
* lib/m4sugar/m4sugar.m4 (m4_tolower, m4_toupper): Quote result.
* lib/autotest/general.m4 (AT_KEYWORDS): Adjust caller.
* tests/m4sugar.at (m4@&t@_toupper and m4@&t@_tolower): New test.
* NEWS: Document this.
* THANKS: Update.
Reported by Sam Steingold.
2009-09-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
DJGPP fix: remove both conftest and conftest.exe.

3
NEWS
View File

@ -21,6 +21,9 @@ GNU Autoconf NEWS - User visible changes.
** The following documented autotest macros are new:
AT_CHECK_EUNIT
** The following m4sugar macros now quote their expansion:
m4_toupper m4_tolower
** The `$tmp' temporary directory used in config.status is documented for
public use now.

1
THANKS
View File

@ -325,6 +325,7 @@ Russ Boylan ross@biostat.ucsf.edu
Ryuji Abe raeva@t3.rim.or.jp
Sam Sexton Sam.Sexton@reuters.com
Sam Sirlin sam@kalessin.jpl.nasa.gov
Sam Steingold sds@gnu.org
Sam Varshavchik mrsam@courier-mta.com
Sander Niemeijer niemeijer@science-and-technology.nl
santilín listas@gestiong.org

View File

@ -1814,8 +1814,8 @@ m4_case([$1],
# Since the -k option is case-insensitive, the list is stored in lower case
# to avoid duplicates that differ only by case.
_AT_DEFINE_SETUP([AT_KEYWORDS],
[m4_append_uniq_w([AT_keywords], m4_tolower(m4_dquote(_m4_expand([$1
]))))])
[m4_append_uniq_w([AT_keywords], m4_tolower(_m4_expand([$1
])))])
# AT_CAPTURE_FILE(FILE)

View File

@ -2266,11 +2266,11 @@ m4_defn([m4_re_string])dnl
#
# Rather than expand the m4_defn each time, we inline them up front.
m4_define([m4_tolower],
[m4_translit([$1], ]m4_dquote(m4_defn([m4_cr_LETTERS]))[,
]m4_dquote(m4_defn([m4_cr_letters]))[)])
[m4_translit([[$1]], ]m4_dquote(m4_defn([m4_cr_LETTERS]))[,
]m4_dquote(m4_defn([m4_cr_letters]))[)])
m4_define([m4_toupper],
[m4_translit([$1], ]m4_dquote(m4_defn([m4_cr_letters]))[,
]m4_dquote(m4_defn([m4_cr_LETTERS]))[)])
[m4_translit([[$1]], ]m4_dquote(m4_defn([m4_cr_letters]))[,
]m4_dquote(m4_defn([m4_cr_LETTERS]))[)])
# m4_split(STRING, [REGEXP])

View File

@ -1292,6 +1292,43 @@ AB
AT_CLEANUP
## ------------------------ ##
## m4_toupper, m4_tolower. ##
## ------------------------ ##
AT_SETUP([m4@&t@_toupper and m4@&t@_tolower])
AT_CHECK_M4SUGAR_TEXT(
[[m4_define([abc], [hI])m4_define([ABC], [Hi])
m4_toupper(abc aBc ABC)
m4_tolower(abc aBc ABC)
m4_toupper([abc aBc ABC])
m4_tolower([abc aBc ABC])
m4_echo(m4_toupper(abc aBc ABC))
m4_echo(m4_tolower(abc aBc ABC))
m4_echo(m4_toupper([abc aBc ABC]))
m4_echo(m4_tolower([abc aBc ABC]))
m4_do(m4_toupper(abc aBc ABC))
m4_do(m4_tolower(abc aBc ABC))
m4_do(m4_toupper([abc aBc ABC]))
m4_do(m4_tolower([abc aBc ABC]))
]], [[
HI ABC HI
hi abc hi
ABC ABC ABC
abc abc abc
HI ABC HI
hi abc hi
ABC ABC ABC
abc abc abc
HI Hi HI
hi hI hi
Hi Hi Hi
hI hI hI
]])
AT_CLEANUP
## --------------- ##
## m4_bpatsubsts. ##
## --------------- ##