Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orphan trailing backslash in pattern #30

Open
magicant opened this issue Sep 14, 2023 · 0 comments
Open

Orphan trailing backslash in pattern #30

magicant opened this issue Sep 14, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@magicant
Copy link
Owner

(Issue migrated from https://osdn.net/projects/yash/ticket/40752)

XCU 2.13.1 Patterns Matching a Single Character:

If a pattern ends with an unescaped backslash, it is unspecified whether the pattern does not match anything or the pattern is treated as invalid.

This means the pattern should not match with any word in bs='\\\'; case word in $bs) echo match; esac. In existing shells, however, one of \, \\ and \\\ matches.


Seems the future version of POSIX is going to say that the entire behavior is unspecified in such a case.

https://www.austingroupbugs.net/view.php?id=1234#c4564

If a pattern ends with an unescaped backslash, the behavior is unspecified.

@magicant magicant added the bug Something isn't working label Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant