* src/tools/update-copyright-year: Fix single-year entry handling.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
diff --git a/ChangeLog b/ChangeLog
index 658ddd9..6d49a9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2021-01-17 Werner Lemberg <wl@gnu.org>
+
+ * src/tools/update-copyright-year: Fix single-year entry handling.
+
2021-01-16 Alexei Podtelezhnikov <apodtele@gmail.com>
* builds/unix/unixddef.mk: Remove the second DEVEL_DIR definition.
diff --git a/src/tools/update-copyright-year b/src/tools/update-copyright-year
index 504f99c..fdd270a 100755
--- a/src/tools/update-copyright-year
+++ b/src/tools/update-copyright-year
@@ -28,20 +28,20 @@ eval '(exit $?0)' && eval 'exec perl -wS -i "$0" ${1+"$@"}'
#
# or
#
-# /* Copyright 2000, 2001, 2004-2007 by */
-# /* foobar */
+# /* Copyright (c) 2000, 2001, 2004-2007 by */
+# /* foobar */
#
# and replaces them uniformly with
#
-# Copyright 2000-2015
+# Copyright (C) 2000-2021
# foobar
#
# and
#
-# /* Copyright 2000-2015 by */
-# /* foobar */
+# /* Copyright (C) 2000-2021 by */
+# /* foobar */
#
-# (assuming that the current year is 2015). As can be seen, the line length
+# (assuming that the current year is 2021). As can be seen, the line length
# is retained if there is non-whitespace after the word `by' on the same
# line.
@@ -80,11 +80,11 @@ while (<>)
{
# Fill line to the same length (if appropriate); we skip the middle
# part but insert `(C)', three spaces, and `-'.
- my $space = length($+{space1}) - 1
- + length($+{middle}) - 1
- + length($+{space2}) - 1
+ my $space = length($+{space1})
+ + length($+{middle})
+ + length($+{space2})
+ length($+{space3})
- - (length("(C)") + 1);
+ - (length("(C)") + 3 + 1);
print "$+{begin}";
print "Copyright\ (C)\ $+{first}-$year\ by";
@@ -107,11 +107,11 @@ while (<>)
}
{
# Fill line to the same length (if appropriate); we insert three
- # spaces, a `-', and the current year.
- my $space = length($+{space1}) - 1
- + length($+{space2}) - 1
+ # spaces, the string `(C)', a `-', and the current year.
+ my $space = length($+{space1})
+ + length($+{space2})
+ length($+{space3})
- - (length($year) + 1);
+ - (length($year) + length("(C)") + 3 + 1);
print "$+{begin}";
print "Copyright\ (C)\ $+{first}-$year\ by";