提交 e66b62b8 编写于 作者: R Richard Levitte

util/mkdef.pl: handle line terminators correctly

When parsing the header files, mkdef.pl didn't clear the line
terminator properly.  In most cases, this didn't matter, but there
were moments when this caused parsing errors (such as CRLFs in certain
cases).

Fixes #4267
Reviewed-by: NAndy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4304)
上级 0ef28021
...@@ -412,10 +412,10 @@ sub do_defs ...@@ -412,10 +412,10 @@ sub do_defs
print STDERR "DEBUG: parsing ----------\n" if $debug; print STDERR "DEBUG: parsing ----------\n" if $debug;
while(<IN>) { while(<IN>) {
s|\R$||; # Better chomp
if($parens > 0) { if($parens > 0) {
#Inside a DEPRECATEDIN #Inside a DEPRECATEDIN
$stored_multiline .= $_; $stored_multiline .= $_;
$stored_multiline =~ s|\R$||; # Better chomp
print STDERR "DEBUG: Continuing multiline DEPRECATEDIN: $stored_multiline\n" if $debug; print STDERR "DEBUG: Continuing multiline DEPRECATEDIN: $stored_multiline\n" if $debug;
$parens = count_parens($stored_multiline); $parens = count_parens($stored_multiline);
if ($parens == 0) { if ($parens == 0) {
...@@ -847,7 +847,6 @@ sub do_defs ...@@ -847,7 +847,6 @@ sub do_defs
\@current_algorithms); \@current_algorithms);
} else { } else {
$stored_multiline = $_; $stored_multiline = $_;
$stored_multiline =~ s|\R$||;
print STDERR "DEBUG: Found multiline DEPRECATEDIN starting with: $stored_multiline\n" if $debug; print STDERR "DEBUG: Found multiline DEPRECATEDIN starting with: $stored_multiline\n" if $debug;
next; next;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册