On 08/15/2011 12:11 PM, Daniel Richard G. wrote:
I am using Autoconf 2.68, and just recently began to take advantage of
its support for multi-line substitutions. Unfortunately, I came across
one minor bug related to this.
If I have e.g.
multiline_var='zero
one
!two
"three'
AC_SUBST([multiline_var])
then in config.log, I see
## ----------------- ##
## Output variables. ##
## ----------------- ##
one
!two
"three'
DEFS='-DPACKAGE_NAME=\"AutoconfBug\" -DPACKAGE_[...]
To be expected - multiline output is being sorted literally, with no way
to escape the newlines into something that keeps the ultimate assignment
located within a single line within the config.log output.
Hmm, now that POSIX will be adding $'' quoting in the next version of
POSIX, and since config.log is informational rather than shell script
(so the non-portability of $'' is not a factor), it might be worth doing
some extra effort in the script to rewrite unsafe substitutions (such as
your multiline case, but also for other control characters) prior to
then sorting the environment collected by the configuration, resulting
in this output in the log:
DEFS='-DPACKAGE_NAME=\"AutoconfBug\" -DPACKAGE_[...]'
multiline_var=$' one\n!two\n"three'
Patches welcome, but it's an enhancement and not a bug fix, so it's not
my highest priority.
--
Eric Blake ebl...@redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org