summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdoxygen/build_man.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/doxygen/build_man.sh b/doxygen/build_man.sh
index a6531cb..8fda7ee 100755
--- a/doxygen/build_man.sh
+++ b/doxygen/build_man.sh
@@ -69,13 +69,19 @@ post_process(){
#keep_me=nfq_icmp_get_hdr.3
#do_diagnostics
- # Decide if we need to fix rendering of verbatim "\n"
+ # Record doxygen version
i=$(doxygen --version)
doxymajor=$(echo $i|cut -f1 -d.)
doxyminor=$(echo $i|cut -f2 -d.)
+
+ # Decide if we need to fix rendering of verbatim "\n"
[ $doxymajor -eq 1 -a $doxyminor -lt 9 ] &&
fix_newlines=true || fix_newlines=false
- #
+
+ # Decide if we need to fix double-to-single-quote conversion
+ [ $doxymajor -eq 1 -a $doxyminor -ge 9 -a $doxyminor < 13 ] &&
+ fix_quotes = true || fix_quotes=false
+
# Work through the "real" man pages
for target in $(ls -S | head -n$page_count)
do grep -Eq "^\\.SH \"Function Documentation" $target || continue
@@ -90,6 +96,13 @@ post_process(){
fix_double_blanks
[ $# -ne 2 ] || insert_see_also $@
+ # Work around doxygen bugs (doxygen version-specific)
+
+ # Best effort: \" becomes \'
+ # Only do lines with some kind of printf,
+ # since other single quotes might be OK as-is.
+ $fix_quotes && sed -i '/printf/s/'\''/"/g' $target
+
# Fix rendering of verbatim "\n" (in code snippets)
$fix_newlines && sed -i 's/\\n/\\\\n/' $target
}&