summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2019-09-07 12:14:29 +0100
committerColin Watson <cjwatson@debian.org>2019-09-07 12:19:24 +0100
commit0fdc8e921622d3614c22082a6934548e4a161bbc (patch)
treebf8fd219dce75136249f8db7938b13d550ebcb95
parent44ec6b98ebfc8f667d3c4f75992544021d733fc0 (diff)
Escape %troff% expansion correctly in manual pages
Fixes part of Debian bug #892230. * configure.ac: Substitute troff_as_troff_input, which is the same as troff but with suitable escaping so that "groff -mandoc" turns into "groff \-mandoc". * man/replace.sin.in (%troff%): Substitute @troff_as_troff_input@ rather than @troff@.
-rw-r--r--configure.ac8
-rw-r--r--man/replace.sin.in2
2 files changed, 9 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 0cbd9c28..09d9d2b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,6 +197,14 @@ then
else
troff="(troff not installed)"
fi
+dnl We want to end up with "-" written as "\-" in manual pages. This
+dnl requires additional \-escaping corresponding to the following quote
+dnl removal steps:
+dnl 1) the following sed command
+dnl 2) the following assignment
+dnl 2) sed running on the substituted version of man/replace.sin.in
+troff_as_troff_input=`echo "$troff" | sed 's/-/\\\\\\\\-/g'`
+AC_SUBST([troff_as_troff_input])
if test -n "$nroff"
then
diff --git a/man/replace.sin.in b/man/replace.sin.in
index 16674b1c..badadcaa 100644
--- a/man/replace.sin.in
+++ b/man/replace.sin.in
@@ -1,6 +1,6 @@
s,%cat%,@cat@,g
s,%pager%,@pager@,g
-s,%troff%,@troff@,g
+s,%troff%,@troff_as_troff_input@,g
s,%date%,@date@,g
s,%sections%,@sections@,g
s,%version%,@VERSION@,g