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 do roff nr expansion before trailin...



details:   https://anonhg.NetBSD.org/src/rev/2bc27728949d
branches:  trunk
changeset: 785845:2bc27728949d
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Apr 03 00:55:32 2013 +0000

description:
do roff nr expansion before trailing backslash

diffstat:

 external/bsd/mdocml/dist/read.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (31 lines):

diff -r 6bc19ce7e13f -r 2bc27728949d external/bsd/mdocml/dist/read.c
--- a/external/bsd/mdocml/dist/read.c   Tue Apr 02 18:35:28 2013 +0000
+++ b/external/bsd/mdocml/dist/read.c   Wed Apr 03 00:55:32 2013 +0000
@@ -344,20 +344,20 @@
                                continue;
                        }
 
+                       /* Expand registers inline */
+                       if ('\\' == blk.buf[i] && 'n' == blk.buf[i + 1]) {
+                               roff_expand_nr(curp->roff,
+                                   blk.buf, &i, blk.sz, &ln.buf, &pos, &ln.sz);
+                               continue;
+                       }
+
                        /* Trailing backslash = a plain char. */
-
                        if ('\\' != blk.buf[i] || i + 1 == (int)blk.sz) {
                                if (pos >= (int)ln.sz)
                                        resize_buf(&ln, 256);
                                ln.buf[pos++] = blk.buf[i++];
                                continue;
                        }
-
-                       if ('\\' == blk.buf[i] && 'n' == blk.buf[i + 1]) {
-                               roff_expand_nr(curp->roff,
-                                   blk.buf, &i, blk.sz, &ln.buf, &pos, &ln.sz);
-                       }
-
                        /*
                         * Found escape and at least one other character.
                         * When it's a newline character, skip it.



Home | Main Index | Thread Index | Old Index