From: Richard Levitte Date: Wed, 8 Apr 2015 17:26:11 +0000 (+0200) Subject: Have mkerr.pl treat already existing multiline string defs properly X-Git-Tag: OpenSSL_0_9_8zg~24 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=32fbe9149e01dc79d97efe13aff2054f77045afb;p=oweals%2Fopenssl.git Have mkerr.pl treat already existing multiline string defs properly Since source reformat, we ended up with some error reason string definitions that spanned two lines. That in itself is fine, but we sometimes edited them to provide better strings than what could be automatically determined from the reason macro, for example: {ERR_REASON(SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER), "Peer haven't sent GOST certificate, required for selected ciphersuite"}, However, mkerr.pl didn't treat those two-line definitions right, and they ended up being retranslated to whatever the macro name would indicate, for example: {ERR_REASON(SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER), "No gost certificate sent by peer"}, Clearly not what we wanted. This change fixes this problem. Reviewed-by: Matt Caswell (cherry picked from commit 2cfdfe0918f03f8323c9523a2beb2b363ae86ca7) Conflicts: util/mkerr.pl --- diff --git a/util/mkerr.pl b/util/mkerr.pl index 8109ab6df9..23e346a946 100644 --- a/util/mkerr.pl +++ b/util/mkerr.pl @@ -452,9 +452,17 @@ EOF # First, read any existing reason string definitions: my %err_reason_strings; if (open(IN,"<$cfile")) { + my $line = ""; while () { - if (/\b(${lib}_R_\w*)\b.*\"(.*)\"/) { - $err_reason_strings{$1} = $2; + chomp; + $_ = $line . $_; + $line = ""; + if (/{ERR_REASON\(/) { + if (/\b(${lib}_R_\w*)\b.*\"(.*)\"/) { + $err_reason_strings{$1} = $2; + } else { + $line = $_; + } } } close(IN);