From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 046c2846 for ; Fri, 8 Jul 2016 17:29:35 -0500 (EST) Date: Fri, 8 Jul 2016 17:29:35 -0500 (EST) Message-Id: <10272542100914331362.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: ISO C99 7.19.2.5 doesn't like mixing putchar(3) and putwchar(3) X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- ISO C99 7.19.2.5 doesn't like mixing putchar(3) and putwchar(3) on the same stream, and actually, it fails spectacularly on glibc. Portability issue pointed out by Svyatoslav Mishyn after testing on Void Linux. Modified Files: -------------- mdocml: main.c main.h term_ascii.c Revision Data ------------- Index: main.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/main.c,v retrieving revision 1.266 retrieving revision 1.267 diff -Lmain.c -Lmain.c -u -p -r1.266 -r1.267 --- main.c +++ main.c @@ -479,7 +479,7 @@ main(int argc, char *argv[]) conf.output.synopsisonly); if (argc > 1 && curp.outtype <= OUTT_UTF8) - ascii_sepline(curp.outdata); + terminal_sepline(curp.outdata); } else if (rc < MANDOCLEVEL_ERROR) rc = MANDOCLEVEL_ERROR; Index: term_ascii.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/term_ascii.c,v retrieving revision 1.52 retrieving revision 1.53 diff -Lterm_ascii.c -Lterm_ascii.c -u -p -r1.52 -r1.53 --- term_ascii.c +++ term_ascii.c @@ -163,18 +163,17 @@ ascii_setwidth(struct termp *p, int iop, } void -ascii_sepline(void *arg) +terminal_sepline(void *arg) { struct termp *p; size_t i; p = (struct termp *)arg; - p->line += 3; - putchar('\n'); + (*p->endline)(p); for (i = 0; i < p->defrmargin; i++) - putchar('-'); - putchar('\n'); - putchar('\n'); + (*p->letter)(p, '-'); + (*p->endline)(p); + (*p->endline)(p); } static size_t Index: main.h =================================================================== RCS file: /home/cvs/mdocml/mdocml/main.h,v retrieving revision 1.24 retrieving revision 1.25 diff -Lmain.h -Lmain.h -u -p -r1.24 -r1.25 --- main.h +++ main.h @@ -43,7 +43,6 @@ void *locale_alloc(const struct manout void *utf8_alloc(const struct manoutput *); void *ascii_alloc(const struct manoutput *); void ascii_free(void *); -void ascii_sepline(void *); void *pdf_alloc(const struct manoutput *); void *ps_alloc(const struct manoutput *); @@ -51,3 +50,4 @@ void pspdf_free(void *); void terminal_mdoc(void *, const struct roff_man *); void terminal_man(void *, const struct roff_man *); +void terminal_sepline(void *); -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv