From: Konstantin Kharlamov <hi-an...@yandex.ru> * 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 <hi-an...@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 <br...@clisp.org> 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