Preserve reason strings in automatically build tables.
authorBodo Möller <bodo@openssl.org>
Sun, 5 Mar 2000 00:19:36 +0000 (00:19 +0000)
committerBodo Möller <bodo@openssl.org>
Sun, 5 Mar 2000 00:19:36 +0000 (00:19 +0000)
22 files changed:
CHANGES
crypto/asn1/asn1_err.c
crypto/bio/bio_err.c
crypto/bn/bn_err.c
crypto/buffer/buf_err.c
crypto/comp/comp_err.c
crypto/conf/conf_err.c
crypto/cpt_err.c
crypto/dh/dh_err.c
crypto/dsa/dsa_err.c
crypto/evp/evp_err.c
crypto/objects/obj_err.c
crypto/pem/pem_err.c
crypto/pkcs12/pk12err.c
crypto/pkcs7/pkcs7err.c
crypto/rand/rand_err.c
crypto/rsa/rsa_err.c
crypto/x509/x509_err.c
crypto/x509v3/v3err.c
rsaref/rsar_err.c
ssl/ssl_err.c
util/mkerr.pl

diff --git a/CHANGES b/CHANGES
index 295e037db414cb74ce559947b00a87b1b7acd7d9..aa752fd973f76368f3ec430400662c5cda837c0d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,12 @@
 
  Changes between 0.9.5 and 0.9.6  [XX XXX 2000]
 
+  *) In util/mkerr.pl (which implements 'make errors'), preserve
+     reason strings from the previous version of the .c file, as
+     the default to have only downcase letters (and digits) in
+     automatically generated reasons codes is not always appropriate.
+     [Bodo Moeller]
+
   *) In ERR_load_ERR_strings(), build an ERR_LIB_SYS error reason table
      using strerror.  Previously, ERR_reason_error_string() returned
      library names as reason strings for SYSerr; but SYSerr is a special
index b1838142423a5bb38e1dd902fd12b3aba5c3d97b..cecd555c882fe36b7c0be9d38c9131acf8bcafd7 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index b5f07de5a055c9bca9be5d2026e176f63735d066..f38e7b917865c38bc829c88f69bb756f2d2c4ffc 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index f3b9497dca03e674670228d575233de27ad88a60..988270bcf4f7ca2d353f933b4266f5ffb6aea204 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index 7f9fd1f6c367b3f5cf3e21cbdb53aff6e731fdf6..2f971a5f38ba839082b165b8d5357844a3d8edac 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index 77a3f7070c511899203f40fe4f696be6be3350d9..c10282a73c929f15acef5dfc1ed52d724c6828f9 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index eb4b3cfc7088c5ddd032df53efb0095b58d5b310..5c1ca59090f14b0c30d06a7101dc5216be73bf7e 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index c2a2dd4af629e7b023e5f15367fcac3fd9611632..dadd8d8d928ccb564f4c73c572cde02df90663f6 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index 0348bd24a2e6c36af9f4caab2001435b2432218e..ff2d1684c214d4652844c3b48ca768e6dd76ffb7 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index 38e4af968cbc56bab2c1370519cfafb41b0aaa32..2b3ab3a9ad8d8027f4cdd6749978c7b143231131 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index 97953a0fc1812f8395b8762cbc7fc0360c5e48f0..fc149cbb1ade641ed77470f7229addfb674e5f01 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index cef401db27719626a0640fedac5529e4277e0be8..7aec0ed47a61aad652adcc7cacf7ed882a543fb6 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index 642129da2043c5fbb968fb5852eba54fc2c18c77..8b1789b11c9acb1dec5cc2fd8e8d6da97ee26883 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index 9d8de10e1e6f9fd2728551f44b85c41a57694acf..12db54f49ef62426f698cd27abe1a03b0c476fd2 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index 813a8af9edcf7a6ab552ef608e241a2c1b44e98e..8ded8913dbf10bfd2ba305754fe5aba953897e76 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index e6a7e56dca9c6dfa70439ff5e7503670a18b7c80..1af0aa0b8ac80c67e626d98f99e7e165c5cd7dee 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index 5cfbea2b033a257467c6b921d73be931a227c426..1cde7c0da46cd2388b4d36d1c015cd33cb10906b 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index fdedbdac3440e7087175afe10f28e6f3d483326a..848add56e9b4e791a9ccd872e20452f550ee4a1e 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index b7d4e350c43a837619dd7abf6185c7c679d18ec0..aa4a605dc48a8ea4bb539a9f044db608dda3c8a0 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index d2eb3a2b0187e9500c0cdc5ebb2aba85a6f3a442..5e7871f8032f019692aea19838118e0a6309379b 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index 5618e34a308572601038b5ce2bab0b53c45ff249..1ffee87522e553a857fadbe957cdc15827fbd2fd 100644 (file)
@@ -54,7 +54,8 @@
  */
 
 /* 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>
index ebc059ef228382cc1d48e148d0dfdcbf1825d102..8e18f3c2dff8d4c75fbf3a3a4c5b6d0279a8c028 100644 (file)
@@ -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)) {