An empty Detailed Description is 3 lines long but a short (1-para) DD is also 3 lines. Check that the 3rd line really is empty. Signed-off-by: Duncan Roe <duncan_roe@xxxxxxxxxxxxxxx> --- doxygen/build_man.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doxygen/build_man.sh b/doxygen/build_man.sh index 63e02dc..852c7b8 100755 --- a/doxygen/build_man.sh +++ b/doxygen/build_man.sh @@ -116,7 +116,11 @@ del_empty_det_desc(){ mygrep "^\\.SH \"Detailed Description" $target [ $linnum -ne 0 ] || return 0 [ $(($i - $linnum)) -eq 3 ] || return 0 - delete_lines $linnum $(($i -1)) + # A 1-line Detailed Description is also 3 lines long, + # but the 3rd line is not empty + i=$(($i -1)) + [ $(tail -n+$i $target | head -n1 | wc -c) -le 2 ] || return 0 + delete_lines $linnum $i } move_synopsis(){ -- 2.17.5