bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multi-line output variables appear incorrectly in config.log


From: Eric Blake
Subject: Re: Multi-line output variables appear incorrectly in config.log
Date: Mon, 15 Aug 2011 14:06:40 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11

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   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]