summaryrefslogtreecommitdiffstats
path: root/unix/installManPage
diff options
context:
space:
mode:
Diffstat (limited to 'unix/installManPage')
-rwxr-xr-xunix/installManPage36
1 files changed, 18 insertions, 18 deletions
diff --git a/unix/installManPage b/unix/installManPage
index 93fd925..3bc3bd7 100755
--- a/unix/installManPage
+++ b/unix/installManPage
@@ -22,34 +22,34 @@ test -z "$S" && S="$DIR/"
# A sed script to parse the alternative names out of a man page.
#
-# /^\\.SH NAME/{ ;# Look for a line, that starts with .SH NAME
-# s/^.*$// ;# Delete the content of this line from the buffer
-# n ;# Read next line
-# s/,//g ;# Remove all commas ...
-# s/\\\ //g ;# .. and backslash-escaped spaces.
-# s/ \\\-.*// ;# Delete from \- to the end of line
-# p ;# print the result
-# q ;# exit
-# }
-#
# Backslashes are trippled in the sed script, because it is in
-# backticks which don't pass backslashes literally.
+# backticks which doesn't pass backslashes literally.
#
-# Please keep the commented version above updated if you
-# change anything to the script below.
NAMES=`sed -n '
- /^\\.SH NAME/{
- s/^.*$//
+ # Look for a line, that starts with .SH NAME
+ # optionally allow NAME to be surrounded
+ # by quotes.
+ /^\.SH "\?NAME"\?/{
+ # Read next line
n
+ # Remove all commas ...
s/,//g
+ # ... and backslash-escaped spaces.
s/\\\ //g
+ # Delete from \- to the end of line
s/ \\\-.*//
- p
- q
+ # print the result and exit
+ p;q
}' $MANPAGE`
-SECTION=`echo $MANPAGE | sed 's/.*\(.\)$/\1/'`
+case $MANPAGE in
+ *.1) SECTION=1 ;;
+ *.3) SECTION=3 ;;
+ *.n) SECTION=n ;;
+esac
+
SRCDIR=`dirname $MANPAGE`
+
FIRST=""
for f in $NAMES; do
f=$f.$SECTION$SUFFIX