]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
src/mkhelp: strip off escape sequences
authorDaniel Stenberg <daniel@haxx.se>
Sun, 23 Jul 2023 14:27:57 +0000 (16:27 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 23 Jul 2023 21:30:51 +0000 (23:30 +0200)
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

src/mkhelp.pl

index ba2e7c1d400d408ec7f83b3f89300885a7456b8b..19a30e2c812d8d4950f87e70a2b15e3bc5beccd2 100755 (executable)
@@ -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