tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* merge back 1.11.3 regression fixes from OpenBSD
@ 2011-06-11 15:26 Ingo Schwarze
  0 siblings, 0 replies; only message in thread
From: Ingo Schwarze @ 2011-06-11 15:26 UTC (permalink / raw)
  To: tech

Hi Kristaps,

here are the fixes i committed to OpenBSD after merging 1.11.3.

chars.c (OpenBSD rev. 1.20):
* Do not pass integers outside the ASCII range to isprint().
* Make sure escaped characters are really printed verbatim
  when the escape sequence has no special meaning.

predefs.in (OpenBSD rev. 1.2):
Some predefined strings got changed in -Tascii mode.
With this fix, they change in other output modes, but -Tascii is what matters.

OK to merge those back to bsd.lv?

Yours,
  Ingo


Index: chars.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/chars.c,v
retrieving revision 1.46
diff -u -p -r1.46 chars.c
--- chars.c	24 May 2011 21:31:23 -0000	1.46
+++ chars.c	11 Jun 2011 15:19:00 -0000
@@ -127,7 +127,7 @@ mchars_num2char(const char *p, size_t sz
 
 	if ((i = mandoc_strntou(p, sz, 10)) < 0)
 		return('\0');
-	return(isprint(i) ? i : '\0');
+	return(i > 0 && i < 256 && isprint(i) ? i : '\0');
 }
 
 /*
@@ -154,8 +154,10 @@ mchars_spec2str(struct mchars *arg, cons
 	const struct ln	*ln;
 
 	ln = find(arg, p, sz);
-	if (NULL == ln)
+	if (NULL == ln) {
+		*rsz = 1;
 		return(NULL);
+	}
 
 	*rsz = strlen(ln->ascii);
 	return(ln->ascii);
Index: predefs.in
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/predefs.in,v
retrieving revision 1.2
diff -u -p -r1.2 predefs.in
--- predefs.in	26 May 2011 14:30:28 -0000	1.2
+++ predefs.in	11 Jun 2011 15:19:00 -0000
@@ -29,13 +29,13 @@ PREDEF("Am", "&")
 PREDEF("Ba", "|")
 PREDEF("Ge", "\\(>=")
 PREDEF("Gt", ">")
-PREDEF("If", "\\(if")
+PREDEF("If", "infinity")
 PREDEF("Le", "\\(<=")
 PREDEF("Lq", "\\(lq")
 PREDEF("Lt", "<")
 PREDEF("Na", "NaN")
 PREDEF("Ne", "\\(!=")
-PREDEF("Pi", "\\(*p")
+PREDEF("Pi", "pi")
 PREDEF("Pm", "\\(+-")
 PREDEF("Rq", "\\(rq")
 PREDEF("left-bracket", "[")
@@ -50,7 +50,7 @@ PREDEF("right-bracket", "]")
 PREDEF("right-parenthesis", ")")
 PREDEF("rp", ")")
 PREDEF("right-singlequote", "\\(cq")
-PREDEF("Tm", "\\(tm")
+PREDEF("Tm", "(Tm)")
 PREDEF("Px", "POSIX")
 PREDEF("Ai", "ANSI")
 PREDEF("\'", "\\\'")
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-11 15:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-11 15:26 merge back 1.11.3 regression fixes from OpenBSD Ingo 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).