NetBSD-Bugs archive

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

bin/43597: Nested quoting in variable expansion breaks



>Number:         43597
>Category:       bin
>Synopsis:       Nested quoting in variable expansion breaks
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 10 15:55:00 +0000 2010
>Originator:     Julio Merino
>Release:        current as of 2010/07/10, netbsd-5 and netbsd-4
>Organization:
Julio Merino
>Environment:
Architecture: x86_64
Machine: amd64
>Description:
        The following construction causes /bin/sh to keep waiting for
        input:

            echo "${foo:="first-word"} second-word"

        When run from a script, it causes a syntax error due to unbalanced
        quotes:

            $ /bin/sh -c 'echo "${foo:="first-word"} second-word"'
            sh: Syntax error: Unterminated quoted string

        If there is no spaces within the first-level string, then things
        work just fine:

            $ /bin/sh -c 'echo "${foo:="first-word"}second-word"'
            first-wordsecond-word

        All these commands work with ksh and bash, so I assume /bin/sh is
        at fault.  Suprisingly, I have confirmed that this problem exists
        in current, in the 5.x branch and in 4.x.

        I found this problem when updating the audacious package in pkgsrc
        to a more recent version.  Its configure script includes the following
        line, which causes it to break:

            ${as_echo:="echo"} "${as_me:="configure"}: touching .deps files"

        Given that this line comes from autoconf internals, I am afraid that
        we can start seeing breakage in more and more packages...
>How-To-Repeat:
        As described above.
>Fix:
        Unknown.



Home | Main Index | Thread Index | Old Index