1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

printf %#H: tweak writing unreserved chars (re: 8477d2ce)

src/cmd/ksh93/bltins/print.c:
- If in UTF-8 locale, only bother to check for unreserved char if
  the character is ASCII (< 128), and write unreserved chars with
  a simple stakputc().
This commit is contained in:
Martijn Dekker 2020-08-13 04:48:44 +01:00
parent a116022625
commit cadd1a81dc

View file

@ -516,8 +516,8 @@ static char *fmthtml(const char *string, int flags)
{
if(c < 0)
stakputs("%3F");
else if(c <= 255 && strchr(URI_RFC3986_UNRESERVED, c))
stakwrite(op, cp-op);
else if(c < 128 && strchr(URI_RFC3986_UNRESERVED, c))
stakputc(c);
else
while(c = *(unsigned char*)op++, op <= cp)
sfprintf(stkstd, "%%%02X", c);