From: Richard Levitte Date: Fri, 13 Dec 2019 10:54:55 +0000 (+0100) Subject: OpenSSL::Util::extract_pod_info(): Allow invisible names X-Git-Tag: openssl-3.0.0-alpha1~780 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8b849cca31335ae23462beeefe8909b42b168983;p=oweals%2Fopenssl.git OpenSSL::Util::extract_pod_info(): Allow invisible names This should be very unusual, but we do have a case of a name we don't want to display. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/10621) --- diff --git a/util/perl/OpenSSL/Util/Pod.pm b/util/perl/OpenSSL/Util/Pod.pm index 9f63bf3f96..ca6d7de2c8 100644 --- a/util/perl/OpenSSL/Util/Pod.pm +++ b/util/perl/OpenSSL/Util/Pod.pm @@ -114,6 +114,7 @@ sub extract_pod_info { die "Unknown input type"; } + my @invisible_names = (); my %podinfo = ( section => $defaults{section}); # Regexp to split a text into paragraphs found at @@ -143,6 +144,16 @@ sub extract_pod_info { $podinfo{lastsecttext} = ""; } + # Add invisible names + if (m|^=for\s+openssl\s+names:\s*(.*)|s) { + my $x = $1; + my @tmp = map { map { s/\s+//g; $_ } split(/,/, $_) } $x; + print STDERR + "DEBUG: Found invisible names: ", join(', ', @tmp), "\n" + if $defaults{debug}; + push @invisible_names, @tmp; + } + next if (m|^=| || m|^\s*$|); # Collect the section text @@ -168,11 +179,12 @@ sub extract_pod_info { split(m|,|, $podinfo{lastsecttext}); print STDERR - "DEBUG: Collected names are: ", join(', ', @names), "\n" + "DEBUG: Collected names are: ", + join(', ', @names, @invisible_names), "\n" if $defaults{debug}; return ( section => $podinfo{section}, - names => [ @names ], + names => [ @names, @invisible_names ], contents => $contents ); }