diff options
| author | pooryorick <com.digitalsmarties@pooryorick.com> | 2018-08-10 15:03:14 (GMT) |
|---|---|---|
| committer | pooryorick <com.digitalsmarties@pooryorick.com> | 2018-08-10 15:03:14 (GMT) |
| commit | e53f3cf9c69144d698f8b7899817243cd4d8d7e5 (patch) | |
| tree | ebd982fc331577a831eef62133f791f432cf2a31 /unix | |
| parent | 12647cc4fb256526efeff88b7add979e3e0c59f7 (diff) | |
| download | tcl-e53f3cf9c69144d698f8b7899817243cd4d8d7e5.zip tcl-e53f3cf9c69144d698f8b7899817243cd4d8d7e5.tar.gz tcl-e53f3cf9c69144d698f8b7899817243cd4d8d7e5.tar.bz2 | |
Tighten up SaveResult.3, make installManPage more robust against newlines.
Diffstat (limited to 'unix')
| -rwxr-xr-x | unix/installManPage | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/unix/installManPage b/unix/installManPage index 1f1cbde..09a31dd 100755 --- a/unix/installManPage +++ b/unix/installManPage @@ -60,20 +60,35 @@ test -z "$SymOrLoc" && SymOrLoc="$Dir/" # Names=`sed -n ' # Look for a line that starts with .SH NAME - /^\.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/ \\\-.*// -# Convert all non-space non-alphanum sequences -# to single underscores. - s/[^ A-Za-z0-9][^ A-Za-z0-9]*/_/g -# print the result and exit - p;q + /^\.SH NAME/,/^\./{ + + + /^\./!{ + + # Remove all commas... + s/,//g + + # ... and backslash-escaped spaces. + s/\\\ //g + + /\\\-.*/{ + # Delete from \- to the end of line + s/ \\\-.*// + h + s/.*/./ + x + } + + # Convert all non-space non-alphanum sequences + # to single underscores. + s/[^ A-Za-z0-9][^ A-Za-z0-9]*/_/g + p + g + /^\./{ + q + } + } + }' $ManPage` if test -z "$Names" ; then |
