Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/mdocml/dist Pull read.c r1.27 from upstream rep...



details:   https://anonhg.NetBSD.org/src/rev/0299384b20f9
branches:  trunk
changeset: 773562:0299384b20f9
user:      joerg <joerg%NetBSD.org@localhost>
date:      Mon Feb 06 10:42:44 2012 +0000

description:
Pull read.c r1.27 from upstream repository:
Don't silently skip non-ASCII characters, but replace them with ``?''.
This is less likely to break the syntax of macros.

diffstat:

 external/bsd/mdocml/dist/read.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (35 lines):

diff -r a6172e0a266c -r 0299384b20f9 external/bsd/mdocml/dist/read.c
--- a/external/bsd/mdocml/dist/read.c   Mon Feb 06 10:40:26 2012 +0000
+++ b/external/bsd/mdocml/dist/read.c   Mon Feb 06 10:42:44 2012 +0000
@@ -1,4 +1,4 @@
-/*     $Vendor-Id: read.c,v 1.26 2011/11/07 01:24:40 schwarze Exp $ */
+/*     $Vendor-Id: read.c,v 1.27 2012/02/05 16:46:15 joerg Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
  * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze%openbsd.org@localhost>
@@ -325,9 +325,9 @@
                         * Warn about bogus characters.  If you're using
                         * non-ASCII encoding, you're screwing your
                         * readers.  Since I'd rather this not happen,
-                        * I'll be helpful and drop these characters so
-                        * we don't display gibberish.  Note to manual
-                        * writers: use special characters.
+                        * I'll be helpful and replace these characters
+                        * with "?", so we don't display gibberish.
+                        * Note to manual writers: use special characters.
                         */
 
                        c = (unsigned char) blk.buf[i];
@@ -335,8 +335,11 @@
                        if ( ! (isascii(c) && 
                                        (isgraph(c) || isblank(c)))) {
                                mandoc_msg(MANDOCERR_BADCHAR, curp,
-                                               curp->line, pos, "ignoring byte");
+                                               curp->line, pos, NULL);
                                i++;
+                               if (pos >= (int)ln.sz)
+                                       resize_buf(&ln, 256);
+                               ln.buf[pos++] = '?';
                                continue;
                        }
 



Home | Main Index | Thread Index | Old Index