bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Replace manually crafted hex regexes with [:xdigit:]


From: Paul Eggert
Subject: [PATCH] Replace manually crafted hex regexes with [:xdigit:]
Date: Sat, 6 Jul 2019 08:00:33 -0700

From: Konstantin Kharlamov <address@hidden>

* build-aux/gitlog-to-changelog (parse_amend_file)
(git_dir_option):
Replace various combinations of [0-9a-fA-F] with [[:xdigit:]].
This patch is backported from Emacs (Bug#36167).
---
 ChangeLog                     | 8 ++++++++
 build-aux/gitlog-to-changelog | 6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bce879101..885907d5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2019-07-06  Konstantin Kharlamov  <address@hidden>
+
+       Replace manually crafted hex regexes with [:xdigit:]
+       * build-aux/gitlog-to-changelog (parse_amend_file)
+       (git_dir_option):
+       Replace various combinations of [0-9a-fA-F] with [[:xdigit:]].
+       This patch is backported from Emacs (Bug#36167).
+
 2019-07-06  Bruno Haible  <address@hidden>
 
        error: Fix documentation.
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 3acfa8b4c..163c48c8e 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -189,7 +189,7 @@ sub parse_amend_file($)
 
       if (!$in_code)
         {
-          $line =~ /^([0-9a-fA-F]{40})$/
+          $line =~ /^([[:xdigit:]]{40})$/
             or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"),
               $fail = 1, next;
           $sha = lc $1;
@@ -303,7 +303,7 @@ sub git_dir_option($)
       my ($sha, $rest) = split ':', $log, 2;
       defined $sha
         or die "$ME:$.: malformed log entry\n";
-      $sha =~ /^[0-9a-fA-F]{40}$/
+      $sha =~ /^[[:xdigit:]]{40}$/
         or die "$ME:$.: invalid SHA1: $sha\n";
 
       my $skipflag = 0;
@@ -391,7 +391,7 @@ sub git_dir_option($)
                   @skipshas = ();
                   next;
               }
-              if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/)
+              if ($found && $_ =~ /^([[:xdigit:]]{7,}) [^ ]/)
               {
                   push ( @skipshas, $1 );
               }
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]