diff --git a/gnu/usr.bin/man/makewhatis/makewhatis.perl b/gnu/usr.bin/man/makewhatis/makewhatis.perl index 4a4ab4465464..599220e127fc 100644 --- a/gnu/usr.bin/man/makewhatis/makewhatis.perl +++ b/gnu/usr.bin/man/makewhatis/makewhatis.perl @@ -370,9 +370,15 @@ sub manual { } else { $list .= '- ' if (!$flag && !/^- /); $flag++; - s/^\.[A-Z][a-z][ \t]*//; - s/[ \t]+$//; - $list .= $_; + if (/^\.Xr/) { + split; + $list .= @_[1]; + $list .= "(@_[2])" if @_[2]; + } else { + s/^\.[A-Z][a-z][ \t]*//; + s/[ \t]+$//; + $list .= $_; + } $list .= ' '; } }