From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: Bugfix: never set termp->enc to the ambiguous value
Date: Wed, 28 Nov 2018 09:23:36 -0500 (EST) [thread overview]
Message-ID: <381d91667b5caa00@fantadrom.bsd.lv> (raw)
Log Message:
-----------
Bugfix: never set termp->enc to the ambiguous value TERMENC_LOCALE,
but instead set it to TERMENC_UTF8 or TERMENC_ASCII.
Makes tbl(7) box drawing work under -T locale (that is, by default
when LC_CTYPE is defined appropriately).
Modified Files:
--------------
mandoc:
term_ascii.c
Revision Data
-------------
Index: term_ascii.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/term_ascii.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -Lterm_ascii.c -Lterm_ascii.c -u -p -r1.63 -r1.64
--- term_ascii.c
+++ term_ascii.c
@@ -90,7 +90,7 @@ ascii_init(enum termenc enc, const struc
p->width = ascii_width;
#if HAVE_WCHAR
- if (TERMENC_ASCII != enc) {
+ if (enc != TERMENC_ASCII) {
/*
* Do not change any of this to LC_ALL. It might break
@@ -99,7 +99,7 @@ ascii_init(enum termenc enc, const struc
* worst case, it might even cause buffer overflows.
*/
- v = TERMENC_LOCALE == enc ?
+ v = enc == TERMENC_LOCALE ?
setlocale(LC_CTYPE, "") :
setlocale(LC_CTYPE, UTF8_LOCALE);
@@ -113,7 +113,7 @@ ascii_init(enum termenc enc, const struc
v = setlocale(LC_CTYPE, "C");
if (v != NULL && MB_CUR_MAX > 1) {
- p->enc = enc;
+ p->enc = TERMENC_UTF8;
p->advance = locale_advance;
p->endline = locale_endline;
p->letter = locale_letter;
--
To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv
reply other threads:[~2018-11-28 14:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=381d91667b5caa00@fantadrom.bsd.lv \
--to=schwarze@mandoc.bsd.lv \
--cc=source@mandoc.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).