* docbook2mdoc: Relax child macro escaping: * No escaping needed in
@ 2019-04-14 12:59 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2019-04-14 12:59 UTC (permalink / raw)
To: source
Log Message:
-----------
Relax child macro escaping:
* No escaping needed in ARG_UPPER mode.
* There are only four callable three-letter macros.
Modified Files:
--------------
docbook2mdoc:
macro.c
Revision Data
-------------
Index: macro.c
===================================================================
RCS file: /home/cvs/mdocml/docbook2mdoc/macro.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -Lmacro.c -Lmacro.c -u -p -r1.11 -r1.12
--- macro.c
+++ macro.c
@@ -112,13 +112,16 @@ macro_addarg(struct format *f, const cha
/* Escape us if we look like a macro. */
- if ((flags & ARG_QUOTED) == 0 &&
+ if ((flags & (ARG_QUOTED | ARG_UPPER)) == 0 &&
(cp == arg || isspace((unsigned char)cp[-1])) &&
isupper((unsigned char)cp[0]) &&
islower((unsigned char)cp[1]) &&
(cp[2] == '\0' || cp[2] == ' ' ||
- (islower((unsigned char)cp[2]) &&
- (cp[3] == '\0' || cp[3] == ' '))))
+ ((cp[3] == '\0' || cp[3] == ' ') &&
+ (strncmp(cp, "Brq", 3) == 0 ||
+ strncmp(cp, "Bro", 3) == 0 ||
+ strncmp(cp, "Brc", 3) == 0 ||
+ strncmp(cp, "Bsx", 3) == 0))))
fputs("\\&", stdout);
if (*cp == '"')
--
To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-04-14 12:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-14 12:59 docbook2mdoc: Relax child macro escaping: * No escaping needed in 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).