]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Escape curly braces in def-check.pl regexes 774/head
authorGreg Hudson <ghudson@mit.edu>
Sat, 5 May 2018 17:40:37 +0000 (13:40 -0400)
committerGreg Hudson <ghudson@mit.edu>
Tue, 8 May 2018 15:58:20 +0000 (11:58 -0400)
Recent versions of Perl issue a warning or error when an unescaped
open curly brace is used in a position where it might introduce a
quantifier in a regular expression.  Escape all regexp literal curly
braces in def-check.pl.

ticket: 8677 (new)
tags: pullup
target_version: 1.16-next
target_version: 1.15-next

src/util/def-check.pl

index a807e6e45be5bce1461b0ffdb67f1258648c0fe1..ccdf8ef16b328f3887eeada2f90076e32a6432fc 100644 (file)
@@ -62,7 +62,7 @@ while (! $h->eof()) {
         next LINE;
     }
     s/#.*$//;
-    if (/^} *$/) {
+    if (/^\} *$/) {
         next LINE;
     }
     # strip comments
@@ -86,18 +86,18 @@ while (! $h->eof()) {
     if (/^[ \t]*$/) {
         next LINE;
     }
-    if (/^ *extern "C" {/) {
+    if (/^ *extern "C" \{/) {
         next LINE;
     }
     s/KRB5_ATTR_DEPRECATED//;
     # elide struct definitions
   Struct1:
-    if (/{[^}]*}/) {
-       s/{[^}]*}/ /g;
+    if (/\{[^}]*\}/) {
+       s/\{[^}]*\}/ /g;
        goto Struct1;
     }
     # multi-line defs
-    if (/{/) {
+    if (/\{/) {
        $_ .= "\n";
        $len1 = length;
        $_ .= $h->getline();