Skip to content

POSIX mode incorrectly rejects i\(text) format #252

Open

Description

@sylvestre

Rust (incorrect - returns error)

$ echo "test" | cargo run --quiet -- -n --posix -e 'i\(text'
 # Error: sed: <script argument 1>:1:3: error: extra characters after \ at the end of `i' command
 # Exit code: 1

GNU (correct)

  $ echo "test" | /usr/bin/sed -n --posix -e 'i\(text'
  # Output: (text
  # Exit code: 0

Bug Found by Fuzzer

Activity

  1. e-kwsm commented on Jan 18, 2026

    @e-kwsm
    Contributor

    POSIX requires newline, i.e.

    i\
    (text
    

    is the valid syntax; i\(text is a GNU extension, and BSD rejects it:

    sed: 1: "i\(text
    ": extra characters after \ at the end of i command
    
  2. e-kwsm commented on Jan 18, 2026

    @e-kwsm
    Contributor

    duplicate of #144.

  3. LoukasPap commented on Feb 9, 2026

    @LoukasPap
    Contributor

    Hello. Should this issue be considered close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions