Ticket #40752

Orphan trailing backslash in pattern

Date d'ouverture: 2020-09-21 16:47 Dernière mise à jour: 2020-10-10 22:16

Rapporteur:
Propriétaire:
Type:
État:
Ouvert [Owner assigned]
Composant:
Jalon:
(Aucun)
Priorité:
3
Sévérité:
3
Résolution:
Postponed
Fichier:
Aucun
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Détails

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/3 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
  • Résolution Update from Aucun to Postponed
Commentaire

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
  • Sévérité Update from 5 - moyen to 3

Attachment File List

No attachments

Modifier

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