• Bug#265208: sed: Sed improperly considers 's/[][]//' an unterminated su

    From Karsten M. Self@1:229/2 to All on Thu Aug 12 09:30:12 2004
    From: [email protected]

    Package: sed
    Version: 4.1.1-1
    Severity: important


    Per regex(7), ']' as the first character of a bracket expression
    characterlist should be considered a literal ']' rather than an
    end-of-brace.

    In 4.0.9, the following substitution works. In 4.1.1, it breaks:

    echo foo | sed -e 's/[][]//'


    As a workaround, the following works:

    echo foo | sed -e 's/[\]\[]//'


    This bug may break many system or local scripts.

    -- System Information:
    Debian Release: 3.1
    APT prefers testing
    APT policy: (990, 'testing')
    Architecture: i386 (i686)
    Kernel: Linux 2.4.20-z1
    Locale: LANG=en_US, LC_CTYPE=en_US

    Versions of packages sed depends on:
    ii libc6 2.3.2.ds1-13 GNU C Library: Shared libraries an

    -- no debconf information


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Paolo Bonzini@1:229/2 to All on Thu Aug 12 10:00:12 2004
    From: [email protected]

    In 4.0.9, the following substitution works. In 4.1.1, it breaks:

    I have a local fix for this. I'll release 4.1.2 ASAP so Clint can pick
    it up for Debian.

    Paolo



    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Karsten M. Self@1:229/2 to Karsten M. Self on Fri Aug 13 22:00:14 2004
    From: [email protected]

    on Thu, Aug 12, 2004 at 03:01:29AM -0400, Karsten M. Self ([email protected]) wrote:
    Package: sed
    Version: 4.1.1-1
    Severity: important


    Per regex(7), ']' as the first character of a bracket expression characterlist should be considered a literal ']' rather than an
    end-of-brace.

    In 4.0.9, the following substitution works. In 4.1.1, it breaks:

    echo foo | sed -e 's/[][]//'


    As a workaround, the following works:

    echo foo | sed -e 's/[\]\[]//'


    This bug may break many system or local scripts.

    Actually, that's wrong twice.

    The workaround merely avoids the syntax error, but doesn't perform the
    intended substitution.

    The problem appears to be the treatment of '[' within a bracket
    expression, rather than ']'. This is not documented, but should IMO be transparently handled: a '[' within an open bracket expression should
    *not* be read as delimiting a new bracket expression, but should be read
    as a character within the current expression.


    Peace.

    --
    Karsten M. Self <[email protected]> http://linuxmafia.com/~karsten
    Ceterum censeo, Caldera delenda est.


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)