]> Savannah Git Hosting - gnulib.git/commitdiff
Replace manually crafted hex regexes with [:xdigit:]
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>
Sat, 6 Jul 2019 14:59:49 +0000 (07:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 6 Jul 2019 15:00:16 +0000 (08:00 -0700)
* 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
build-aux/gitlog-to-changelog

index bce879101434768924cc959bf9dfad054ef5d487..885907d5c6d680e000d3f99f12ce6f97399f06c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2019-07-06  Konstantin Kharlamov  <Hi-Angel@yandex.ru>
+
+       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  <bruno@clisp.org>
 
        error: Fix documentation.
index 3acfa8b4c5b67bc050e587470eac9987cc862f00..163c48c8e215508e7e702096c10765eae0a3c064 100755 (executable)
@@ -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 );
               }