ref: 51a73e9b3ac7061a9df560f8f4a2484447181fdc
parent: d38caa1bee4fc59e86f2cc1de2787d319ac2bffe
author: qwx <qwx@sciops.net>
date: Sun Sep 28 19:24:10 EDT 2025
fix printf %c format not being utf-aware
--- a/run.c
+++ b/run.c
@@ -817,6 +817,7 @@
{char *fmt;
char *p, *t, *os;
+ Rune r;
Cell *x;
int flag, n;
int fmtwd; /* format width */
@@ -893,6 +894,7 @@
flag = 4;
break;
case 'c':
+ t[-1] = 'C';
flag = 5;
break;
default:
@@ -940,8 +942,8 @@
*p = '\0';
}
} else {- if((*p = getsval(x)[0]) != '\0')
- p++;
+ chartorune(&r, getsval(x));
+ p += runetochar(p, &r);
*p = '\0';
}
break;
--
⑨