* mandoc: Bugfix: never set termp->enc to the ambiguous value
@ 2018-11-28 14:23 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2018-11-28 14:23 UTC (permalink / raw)
To: source
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-11-28 14:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-28 14:23 mandoc: Bugfix: never set termp->enc to the ambiguous value schwarze
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).