21,26d20
< # Wed Feb 2 00:00:30 EDT 1995
< # Modified to handle more GROFF commands and more severely split
< # up command title lines by Christopher Neufeld
< # (neufeld@physics.utoronto.ca)
< 
< 
100c94
< 	gawk 'BEGIN {after = 0; insh = 0; wordjoin = 1; toklen = 0;
---
>             gawk 'BEGIN {after = 0; insh = 0; wordjoin = 1;
113,114c107
< 	    (pages == "cat" && ($1 ~ /^[DS][yYeE][SsNn][CcOo]/ ||
< 	     $0 ~ /^[^ \\t\\n]/) || ($0 ~ / - / && after))) {
---
>                         (pages == "cat" && $1 ~ /^[DS][yYeE]/)) {
116d108
< 		toklen = 0
136,141d127
< 		sub(/^.Nm /, "")	# Kill bold
< 		sub(/^.Tn /, "")	# Kill normal
< 		sub(/^.Li /, "")	# Kill something
< 		sub(/^.Nd */, " - ")	# Convert .Nd to dash
< 		gsub(/  */, " ")	# Kill extra spaces after dash
< 		sub(/^.Dq /, "")	# Kill .Dq
156d141
< 			toklen = 0
159c144
< 		    if ($1 !~ /^\.../ && $1 != "") {
---
>                                 if ($1 !~ /^\.../ && $1 != "")
161,162d145
< 			toklen = length
< 		    }
168,170d150
< 			if ($0 ~ /^ - /) {
< 			    printf "%-*s", 19-toklen, sprintf( "(%s)", section )
< 			} else {
173d152
< 			}
176,177c155
< 		    } else
< 			if ($0 ~ / -$/) {
---
>                             } else if ($0 ~ / -$/) {
198,202c176
<     cat /tmp/whatis$$ /tmp/oldwhatis$$ | \
<     	sed -e '/^ *$/d'\
< 	    -e 's/^ *//'\
< 	    -e 's/-  */- /'\
< 	    -e 's/  *$//' | sort | uniq > ${mandir}/whatis
---
>     cat /tmp/whatis$$ /tmp/oldwhatis$$ | sed '/^$/d' | sort | uniq > ${mandir}/whatis
205,208c179
<     sed -e '/^ *$/d'\
< 	-e 's/^ *//'\
< 	-e 's/-  */- /'\
< 	-e 's/  *$//' < /tmp/whatis$$ | sort | uniq > ${mandir}/whatis
---
>     sed '/^$/d' < /tmp/whatis$$ | sort | uniq > ${mandir}/whatis
