src/mkhelp: strip off escape sequences

At some point the nroff command stopped stripping off escape sequences,
so then this script needs to do the job instead.

Reported-by: VictorVG on github
Fixes #11501
Closes #11503
This commit is contained in:
Daniel Stenberg 2023-07-23 16:27:57 +02:00
parent 57f56cc374
commit e310497a9a
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -51,6 +51,7 @@ while (<STDIN>) {
# remove trailing CR from line. msysgit checks out files as line+CRLF
$line =~ s/\r$//;
$line =~ s/\x1b\x5b[0-9]+m//g; # escape sequence
if($line =~ /^([ \t]*\n|curl)/i) {
# cut off headers and empty lines
$wline++; # count number of cut off lines