aboutsummaryrefslogtreecommitdiff
path: root/util/mkerr.pl
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-03-05 00:19:36 +0000
committerBodo Möller <bodo@openssl.org>2000-03-05 00:19:36 +0000
commit59fc2b0fc21f0c90a328edb7b2755c242adfb27a (patch)
tree8ea25ac20ed309b25f8086c13fbd543e1c8e7468 /util/mkerr.pl
parent5ba7c902e559a695ed202042b8dd4c893bdb0ae7 (diff)
downloadopenssl-59fc2b0fc21f0c90a328edb7b2755c242adfb27a.zip
openssl-59fc2b0fc21f0c90a328edb7b2755c242adfb27a.tar.gz
openssl-59fc2b0fc21f0c90a328edb7b2755c242adfb27a.tar.bz2
Preserve reason strings in automatically build tables.
Diffstat (limited to 'util/mkerr.pl')
-rw-r--r--util/mkerr.pl26
1 files changed, 21 insertions, 5 deletions
diff --git a/util/mkerr.pl b/util/mkerr.pl
index ebc059e..8e18f3c 100644
--- a/util/mkerr.pl
+++ b/util/mkerr.pl
@@ -284,6 +284,17 @@ EOF
# Rewrite the C source file containing the error details.
+ # First, read any existing reason string definitions:
+ my %err_reason_strings;
+ if (open(IN,"<$cfile")) {
+ while (<IN>) {
+ if (/\b(${lib}_R_\w*)\b.*\"(.*)\"/) {
+ $err_reason_strings{$1} = $2;
+ }
+ }
+ close(IN);
+ }
+
my $hincf;
if($static) {
$hfile =~ /([^\/]+)$/;
@@ -352,7 +363,8 @@ EOF
*/
/* NOTE: this file was auto generated by the mkerr.pl script: any changes
- * made to it will be overwritten when the script next updates this file.
+ * made to it will be overwritten when the script next updates this file,
+ * only reason strings will be preserved.
*/
#include <stdio.h>
@@ -385,9 +397,13 @@ EOF
foreach $i (@reasons) {
my $rn;
my $nspc = 0;
- $i =~ /^${lib}_R_(\S+)$/;
- $rn = $1;
- $rn =~ tr/_[A-Z]/ [a-z]/;
+ if (exists $err_reason_strings{$i}) {
+ $rn = $err_reason_strings{$i};
+ } else {
+ $i =~ /^${lib}_R_(\S+)$/;
+ $rn = $1;
+ $rn =~ tr/_[A-Z]/ [a-z]/;
+ }
$nspc = 40 - length($i) unless length($i) > 40;
$nspc = " " x $nspc;
print OUT "{${i}${nspc},\"$rn\"},\n";
@@ -465,7 +481,7 @@ EOF
}
close OUT;
-
+ undef %err_reason_strings;
}
if($debug && defined(%notrans)) {