Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] add STOUC() to casemodify() without MULTIBYTE_SUPPORT
- X-seq: zsh-workers 50080
- From: Jun T <takimoto-j@xxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] add STOUC() to casemodify() without MULTIBYTE_SUPPORT
- Date: Mon, 18 Apr 2022 16:54:39 +0900
- Archived-at: <https://zsh.org/workers/50080>
- List-id: <zsh-workers.zsh.org>
On NetBSD, with --disable-multibyte, D01prompt.zsh fails as follows:
@@ -1 +1 @@
-
+V
Test ./D01prompt.ztst failed: output differs from expected as shown above for:
print ${(%U)Y-%(v}
Was testing: Regression test for test on empty psvar
We need to add STOUC() in casemodify():
diff --git a/Src/hist.c b/Src/hist.c
index f9440dba7..bff0abe61 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -2254,10 +2254,10 @@ casemodify(char *str, int how)
int c;
int mod = 0;
if (*str == Meta) {
- c = str[1] ^ 32;
+ c = STOUC(str[1] ^ 32);
str += 2;
} else
- c = *str++;
+ c = STOUC(*str++);
switch (how) {
case CASMOD_LOWER:
if (isupper(c)) {
Messages sorted by:
Reverse Date,
Date,
Thread,
Author