aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-12-26 02:55:28 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-12-26 02:55:28 +0000
commit865fac002b3785b0bc14e58c348020aa9799a633 (patch)
tree5b9d9a8c55fe22478f40c3138b3ad5e6ff235ffe /mandoc.c
parent1f2f79b1d92af775253a314d6794bca6fbd19729 (diff)
downloadmandoc-865fac002b3785b0bc14e58c348020aa9799a633.tar.gz
mandoc-865fac002b3785b0bc14e58c348020aa9799a633.tar.zst
mandoc-865fac002b3785b0bc14e58c348020aa9799a633.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.
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/mandoc.c b/mandoc.c
index da953214..58e3aca3 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.72 2013/12/25 22:45:33 schwarze Exp $ */
+/* $Id: mandoc.c,v 1.73 2013/12/26 02:55:28 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
@@ -165,12 +165,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'):
@@ -185,8 +189,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'):
@@ -194,19 +196,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;