aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-09-03 14:31:21 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-09-03 14:31:21 -0400
commitde7b564a91dae14f61732117450e23c5898f75f2 (patch)
tree87b1b08da240fa50e227d7b477c9c8ebca0a771d
parent91c5dc61c18d6e4c9825086b1ee96239010cad76 (diff)
Escape question marks in patterns
-rw-r--r--builtins/text.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtins/text.c b/builtins/text.c
index d23f2dc3..00958743 100644
--- a/builtins/text.c
+++ b/builtins/text.c
@@ -1695,7 +1695,8 @@ public Pattern_t Pattern$escape_text(Text_t text)
if (g == '{') {
add_str("{1{}");
- } else if (uc_is_property_quotation_mark(g0)
+ } else if (g0 == '?'
+ || uc_is_property_quotation_mark(g0)
|| (uc_is_property_paired_punctuation(g0) && uc_is_property_left_of_pair(g0))) {
add_char('{');
add_char('1');