Ticket #40752

Orphan trailing backslash in pattern

Open Date: 2020-09-21 16:47 Last Update: 2023-09-14 23:35

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
(None)
Priority:
3
Severity:
3
Resolution:
Postponed
File:
None
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

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 bs='\\\'; case word in $bs) echo match; esac should not match for any word. In existing shells, however, this case matches for one of \, \\ and \\\ depending on the shell.

Ticket History (3/4 Histories)

2020-09-21 16:47 Updated by: magicant
  • New Ticket "Orphan trailing backslash in pattern" created
2020-09-21 22:58 Updated by: magicant
  • Resolution Update from None to Postponed
Comment

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.

2020-10-10 22:16 Updated by: magicant
  • Severity Update from 5 - Medium to 3
2023-09-14 23:35 Updated by: magicant
  • Status Update from Open to Closed

Attachment File List

No attachments

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login