Project Info Name.......: gnu-hello
Description: GNU Hello


gnu-hello       
Info
Commit...:059d8d620ce038c575fe4c9605ca0fb377099718
Author...:Sami Kerola
Committer:Reuben Thomas
Date.....:Wed Oct 9 20:20:16 2013 +0100
Parents..:31ee5a3f414b4fdf5296b13a043d0799af4e4326

Message
make copyright year pseudo dynamic

configure.ac: Add macro to determine what year is it, and add the value
to config.h.
hello.c: Use copyright year from config.h.

Changes
diff --git a/configure.ac b/configure.ac
line changes: +4/-0
index f33d65a..7e7acc8
--- a/configure.ac
+++ b/configure.ac
@@ -31,6 +31,10 @@ dnl keep everything together.
 gl_EARLY
 gl_INIT
 
+dnl Copyright will apply as long as these sources are in use, e.g., are
+dnl being compiled, which is reasonable year to claim the copyright.
+AC_DEFINE([COPYRIGHT_YEAR], [m4_esyscmd([date +%Y])], [year in copyright message])
+
 dnl GNU help2man creates man pages from --help output; in many cases, this
 dnl is sufficient, and obviates the need to maintain man pages separately.
 dnl However, this means invoking executables, which we generally cannot do

diff --git a/src/hello.c b/src/hello.c
line changes: +2/-2
index c4b98ba..8ecdf7b
--- a/src/hello.c
+++ b/src/hello.c
@@ -200,8 +200,8 @@ print_version (void)
      as done here, to avoid having to retranslate the message when a new
      year comes around.  */
   printf (_("\
-Copyright (C) %s Free Software Foundation, Inc.\n\
+Copyright (C) %d Free Software Foundation, Inc.\n\
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\
 This is free software: you are free to change and redistribute it.\n\
-There is NO WARRANTY, to the extent permitted by law.\n"), "2011");
+There is NO WARRANTY, to the extent permitted by law.\n"), COPYRIGHT_YEAR);
 }

This website is licensed under AGPL-3.0. Feel free to copy!