Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1500 Bash: Fix quoted HereDoc delimiters handling

Bug
closed-fixed
Neil Hodgson
5
2013-08-31
2013-07-22
No

Bash quoted HereDoc delimiters seem to allow pretty much anything as part of the delimiter, not only identifiers. E.g. the following snippet is valid:

cat << EOF
line1
line2
EOF

echo "ouside"

cat << '\A \\B \'
line1
line2
\A \\B \

echo "ouside"

cat << "\A \\B \"C"
line1
line2
\A \B "C

echo "ouside"

Currently the Bash lexer doesn't handle quoted delimiter differently from non-quoted ones apart from the quotes themselves, which leads to broken highlighting if a quoted delimiter contains anything but an identifier.

Attached is a patch fixing the issue by properly handling the quoted delimiters.

1 Attachments

Discussion

  • Kein-Hong Man
    Kein-Hong Man
    2013-07-22

    I'm occupied with other things at the moment; looks fine by me. Perl coders seem to be amazingly good at hitting corner cases... :-p

     
  • Neil Hodgson
    Neil Hodgson
    2013-07-23

    Commited as [bb784e].

     

    Related

    Commit: [bb784e]

  • Neil Hodgson
    Neil Hodgson
    2013-07-23

    • status: open --> open-fixed
    • assigned_to: Neil Hodgson
     
  • Neil Hodgson
    Neil Hodgson
    2013-08-31

    • status: open-fixed --> closed-fixed