Skip to content

expand: regression in handling of escape sequences in heredocs #1138

Closed

Description

@NorbertHauriel

I discovered a regression indirectly by using Task, which depends on mvdan/sh. See the below issue for the details:
go-task/task#2129

To summarize, mvdan/sh v3.11.0 is found to ignore the character escaping in this example script, so double backslash is taken literally instead of being parsed as an escape sequence that would result in a single backslash. The older version v3.10.0 takes the double slashes as an escape sequence, as expected. Below is the script I indirectly executed using the Task CLI tool:

cat <<EOF > ./test.txt
\\
EOF

Activity

  1. mvdan commented on Mar 19, 2025

    @mvdan
    Owner

    Thanks. This was part of another fix for go-task, #1070, but it wasn't quite right.

  2. changed the title [-]Regression: character escaping ignored[/-] [+]expand: regression in handling of escape sequences in heredocs[/+] on Mar 19, 2025
  3. added a commit that references this issue on Mar 20, 2025
    096576f
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址