Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Done
-
PUP 3.7.5, PUP 4.0.0
-
None
-
1
-
Language 2015-04-29, Language 2015-05-13
-
Bug Fix
Description
Ran:
$thing = "hi there"
|
notice(@("END INTERP"))
|
This string should be able to interpolate variables, and all backslashes should
|
be interpreted as plain old literal backslashes.
|
Variable standing apart: ${thing}
|
Variable enjambed: hey${thing}
|
Variable with single backslash enjambed: \${thing}
|
Variable with double backslash enjambed: \\${thing}
|
END INTERP
|
The single backslash before the $ causes a problem. I'm pretty sure this is against the specification of heredocs.
Actual result:
Notice: Scope(Class[main]): This string should be able to interpolate variables, and all backslashes should
|
be interpreted as plain old literal backslashes.
|
Variable standing apart: hi there
|
Variable enjambed: heyhi there
|
Variable with single backslash enjambed: \${thing}
|
Variable with double backslash enjambed: \\hi there
|
|
Expected result:
Notice: Scope(Class[main]): This string should be able to interpolate variables, and all backslashes should
|
be interpreted as plain old literal backslashes.
|
Variable standing apart: hi there
|
Variable enjambed: heyhi there
|
Variable with single backslash enjambed: \hi there
|
Variable with double backslash enjambed: \\hi there
|
|
3.7.5 and 4.0.0 behave identically.
In addition, if any escape (other than '$' escapes) are turned on, it also turns on escaping of '$'. This is caused by the same faulty logic.
QA
risk: medium (validate only)
probability: low (single backslash directly before interpolation in pp heredoc)
severity: medium (obvious issue, workarounds)
test level: unit