From 4a083b0d36a8b2afe23447dbc357de3641140d4d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 24 Oct 2019 14:32:06 -0700 Subject: Update from Gnulib This incorporates: 2019-10-23 nstrftime: speed up integer overflow checking 2019-10-23 port better to GCC under macOS 2019-10-15 inttypes: use more-robust test for int range 2019-10-14 update-copyright: use en dashes in .texi ranges * build-aux/update-copyright, lib/intprops.h, lib/inttypes.in.h: * lib/nstrftime.c, lib/verify.h: Copy from Gnulib. --- build-aux/update-copyright | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'build-aux') diff --git a/build-aux/update-copyright b/build-aux/update-copyright index b3f6b298056..e4809f620d6 100755 --- a/build-aux/update-copyright +++ b/build-aux/update-copyright @@ -98,7 +98,7 @@ # 6. Blank lines, even if preceded by the prefix, do not appear # within the FSF copyright statement. # 7. Each copyright year is 2 or 4 digits, and years are separated by -# commas or dashes. Whitespace may appear after commas. +# commas, "-", or "--". Whitespace may appear after commas. # # Environment variables: # @@ -192,7 +192,7 @@ while (/(^|\n)(.{0,$prefix_max})$copyright_re/g) $holder_re =~ s/\s/$ws_re/g; my $stmt_remainder_re = "(?:$ws_re$circle_c_re)?" - . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*" + . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|--?))*" . "((?:\\d\\d)?\\d\\d)$ws_re$holder_re"; if (/\G$stmt_remainder_re/) { @@ -231,26 +231,28 @@ if (defined $stmt_re) # Make the use of intervals consistent. if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS}) { - $stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg; + $stmt =~ s/(\d{4})--?(\d{4})/join(', ', $1..$2)/eg; } else { + my $ndash = $ARGV =~ /\.tex(i(nfo)?)?$/ ? "--" : "-"; + $stmt =~ s/ (\d{4}) (?: - (,\ |-) + (,\ |--?) ((??{ - if ($2 eq '-') { '\d{4}'; } + if ($2 ne ', ') { '\d{4}'; } elsif (!$3) { $1 + 1; } else { $3 + 1; } })) )+ - /$1-$3/gx; + /$1$ndash$3/gx; # When it's 2, emit a single range encompassing all year numbers. $ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2 - and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/; + and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1$ndash$2/; } # Format within margin. -- cgit v1.2.1