patch 9.1.0703: crash with 2byte encoding and glob2regpat()
Problem: possible crash with 2-byte encoding and glob2regpat()
(after v9.1.0700, v9.1.0702)
Solution: include both bytes for a multi-byte character for an
escaped character
closes: #15590
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/fileio.c b/src/fileio.c
index d27a172..5fee4e0 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5714,6 +5714,8 @@
)
*allow_dirs = TRUE;
reg_pat[i++] = '\\';
+ if (enc_dbcs != 0 && (*mb_ptr2len)(p) > 1)
+ reg_pat[i++] = *p++;
reg_pat[i++] = *p;
}
break;