diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-10 15:25:23 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2024-06-10 15:25:23 (GMT) |
| commit | e6843a795b4572ae7dbe75d60b04cea43dae9c48 (patch) | |
| tree | a802b08617346bdbfb1151c4a05eb0bb09eada2a | |
| parent | 9fe1ca1deadbb5e38e31b93203ce6722c85251d4 (diff) | |
| download | tcl-e6843a795b4572ae7dbe75d60b04cea43dae9c48.zip tcl-e6843a795b4572ae7dbe75d60b04cea43dae9c48.tar.gz tcl-e6843a795b4572ae7dbe75d60b04cea43dae9c48.tar.bz2 | |
Make installManPage more robust against newlines. Backported from 8.7
| -rwxr-xr-x | unix/installManPage | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/unix/installManPage b/unix/installManPage index 1e29bb0..3d5fa7b 100755 --- a/unix/installManPage +++ b/unix/installManPage @@ -61,20 +61,35 @@ test -z "$Sym" && Loc="$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 |
