diff options
author | 2013-12-26 02:55:35 +0000 | |
---|---|---|
committer | 2013-12-26 02:55:35 +0000 | |
commit | 9fd5f1f0a1689045c65fe40c001e1bf5ba3ba70e (patch) | |
tree | 1094df836b5804a5a02705c48a6b28b2fcca1e5c | |
parent | The roff language really has two groups of basic building blocks: (diff) | |
download | wireguard-openbsd-9fd5f1f0a1689045c65fe40c001e1bf5ba3ba70e.tar.xz wireguard-openbsd-9fd5f1f0a1689045c65fe40c001e1bf5ba3ba70e.zip |
I have no idea how it happened that \B, \H, \h, \L, and \l got
mapped to ESCAPE_NUMBERED (which is for \N and only for \N), that
made no sense at all. Properly remap them to ESCAPE_IGNORE.
While here, move \B and \w from the group taking number arguments
to the group taking string arguments; right now, that doesn't imply
any functional change, but if we ever go ahead and implement a
parser for roff(7) numerical expressions, it will suddenly start
to matter, and cause confusion.
-rw-r--r-- | usr.bin/mandoc/mandoc.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.bin/mandoc/mandoc.c b/usr.bin/mandoc/mandoc.c index 43de450cc37..b48a0917527 100644 --- a/usr.bin/mandoc/mandoc.c +++ b/usr.bin/mandoc/mandoc.c @@ -1,4 +1,4 @@ -/* $Id: mandoc.c,v 1.41 2013/12/25 22:45:16 schwarze Exp $ */ +/* $Id: mandoc.c,v 1.42 2013/12/26 02:55:35 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org> @@ -161,12 +161,16 @@ mandoc_escape(const char const **end, const char const **start, int *sz) /* FALLTHROUGH */ case ('b'): /* FALLTHROUGH */ + case ('B'): + /* FALLTHROUGH */ case ('D'): /* FALLTHROUGH */ case ('o'): /* FALLTHROUGH */ case ('R'): /* FALLTHROUGH */ + case ('w'): + /* FALLTHROUGH */ case ('X'): /* FALLTHROUGH */ case ('Z'): @@ -181,8 +185,6 @@ mandoc_escape(const char const **end, const char const **start, int *sz) * These escapes are of the form \X'N', where 'X' is the trigger * and 'N' resolves to a numerical expression. */ - case ('B'): - /* FALLTHROUGH */ case ('h'): /* FALLTHROUGH */ case ('H'): @@ -190,19 +192,15 @@ mandoc_escape(const char const **end, const char const **start, int *sz) case ('L'): /* FALLTHROUGH */ case ('l'): - gly = ESCAPE_NUMBERED; /* FALLTHROUGH */ case ('S'): /* FALLTHROUGH */ case ('v'): /* FALLTHROUGH */ - case ('w'): - /* FALLTHROUGH */ case ('x'): if ('\'' != **start) return(ESCAPE_ERROR); - if (ESCAPE_ERROR == gly) - gly = ESCAPE_IGNORE; + gly = ESCAPE_IGNORE; *start = ++*end; term = '\''; break; |