-
-
Notifications
You must be signed in to change notification settings - Fork 727
Open
Description
Describe the bug
When evaluating expression with backslashes in strings, the number of backslashes in output strings got halved.
Version of yq: 4.50.1
Operating system: linux
Installed via: binary release
Incorrect behavior (string in expression)
$ yq -Pn -oj '["\\","\\\\","\\\\\\","\\\\\\\\","\\\\\\\\\\","\\\\\\\\\\\\"]'
[
"\\",
"\\",
"\\\\",
"\\\\",
"\\\\\\",
"\\\\\\"
]
$ jq -n '["\\","\\\\","\\\\\\","\\\\\\\\","\\\\\\\\\\","\\\\\\\\\\\\"]'
[
"\\",
"\\\\",
"\\\\\\",
"\\\\\\\\",
"\\\\\\\\\\",
"\\\\\\\\\\\\"
]Correct behavior (string from input)
$ yq -P -oj <<< '["\\","\\\\","\\\\\\","\\\\\\\\","\\\\\\\\\\","\\\\\\\\\\\\"]'
[
"\\",
"\\\\",
"\\\\\\",
"\\\\\\\\",
"\\\\\\\\\\",
"\\\\\\\\\\\\"
]