diff options
author | beck <> | 2000-04-15 06:18:51 +0000 |
---|---|---|
committer | beck <> | 2000-04-15 06:18:51 +0000 |
commit | b608c7f2b175e121f2c22d53341a317153afdc8e (patch) | |
tree | e94b160b3fcd8180df79e4251d68d24d665f0195 /src/lib/libcrypto/util/mkerr.pl | |
parent | c8d6701c396cebdcd0d45eac73b762e9498f6b01 (diff) | |
download | openbsd-b608c7f2b175e121f2c22d53341a317153afdc8e.tar.gz openbsd-b608c7f2b175e121f2c22d53341a317153afdc8e.tar.bz2 openbsd-b608c7f2b175e121f2c22d53341a317153afdc8e.zip |
OpenSSL 0.9.5a merge
Diffstat (limited to 'src/lib/libcrypto/util/mkerr.pl')
-rw-r--r-- | src/lib/libcrypto/util/mkerr.pl | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/lib/libcrypto/util/mkerr.pl b/src/lib/libcrypto/util/mkerr.pl index ebc059ef22..8e18f3c2df 100644 --- a/src/lib/libcrypto/util/mkerr.pl +++ b/src/lib/libcrypto/util/mkerr.pl | |||
@@ -284,6 +284,17 @@ EOF | |||
284 | 284 | ||
285 | # Rewrite the C source file containing the error details. | 285 | # Rewrite the C source file containing the error details. |
286 | 286 | ||
287 | # First, read any existing reason string definitions: | ||
288 | my %err_reason_strings; | ||
289 | if (open(IN,"<$cfile")) { | ||
290 | while (<IN>) { | ||
291 | if (/\b(${lib}_R_\w*)\b.*\"(.*)\"/) { | ||
292 | $err_reason_strings{$1} = $2; | ||
293 | } | ||
294 | } | ||
295 | close(IN); | ||
296 | } | ||
297 | |||
287 | my $hincf; | 298 | my $hincf; |
288 | if($static) { | 299 | if($static) { |
289 | $hfile =~ /([^\/]+)$/; | 300 | $hfile =~ /([^\/]+)$/; |
@@ -352,7 +363,8 @@ EOF | |||
352 | */ | 363 | */ |
353 | 364 | ||
354 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | 365 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes |
355 | * made to it will be overwritten when the script next updates this file. | 366 | * made to it will be overwritten when the script next updates this file, |
367 | * only reason strings will be preserved. | ||
356 | */ | 368 | */ |
357 | 369 | ||
358 | #include <stdio.h> | 370 | #include <stdio.h> |
@@ -385,9 +397,13 @@ EOF | |||
385 | foreach $i (@reasons) { | 397 | foreach $i (@reasons) { |
386 | my $rn; | 398 | my $rn; |
387 | my $nspc = 0; | 399 | my $nspc = 0; |
388 | $i =~ /^${lib}_R_(\S+)$/; | 400 | if (exists $err_reason_strings{$i}) { |
389 | $rn = $1; | 401 | $rn = $err_reason_strings{$i}; |
390 | $rn =~ tr/_[A-Z]/ [a-z]/; | 402 | } else { |
403 | $i =~ /^${lib}_R_(\S+)$/; | ||
404 | $rn = $1; | ||
405 | $rn =~ tr/_[A-Z]/ [a-z]/; | ||
406 | } | ||
391 | $nspc = 40 - length($i) unless length($i) > 40; | 407 | $nspc = 40 - length($i) unless length($i) > 40; |
392 | $nspc = " " x $nspc; | 408 | $nspc = " " x $nspc; |
393 | print OUT "{${i}${nspc},\"$rn\"},\n"; | 409 | print OUT "{${i}${nspc},\"$rn\"},\n"; |
@@ -465,7 +481,7 @@ EOF | |||
465 | } | 481 | } |
466 | 482 | ||
467 | close OUT; | 483 | close OUT; |
468 | 484 | undef %err_reason_strings; | |
469 | } | 485 | } |
470 | 486 | ||
471 | if($debug && defined(%notrans)) { | 487 | if($debug && defined(%notrans)) { |