]> Savannah Git Hosting - gnulib.git/commitdiff
version-etc: allow zero authors
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 21 Dec 2018 00:10:29 +0000 (16:10 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 21 Dec 2018 00:14:29 +0000 (16:14 -0800)
* lib/version-etc.c (version_etc_arn): If no authors are given,
omit authorship info instead of dumping core.
No need to include stdlib.h now.

ChangeLog
lib/version-etc.c

index fd28f3b2c56268f4208456ff7ecb53c96605e37b..89407e15e7eb11b6d70b7ab30ae4008ed6eecdc0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-12-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+       version-etc: allow zero authors
+       * lib/version-etc.c (version_etc_arn): If no authors are given,
+       omit authorship info instead of dumping core.
+
 2018-12-19  Bruno Haible  <bruno@clisp.org>
 
        lchown tests: Be more permissive regarding errno values.
index 56dc249296ae3f7e476196c9fd1c9941350ba706..dfec8ad5a06593b94af497829084c233dd73cdf6 100644 (file)
@@ -23,7 +23,6 @@
 
 #include <stdarg.h>
 #include <stdio.h>
-#include <stdlib.h>
 
 #if USE_UNLOCKED_IO
 # include "unlocked-io.h"
@@ -95,8 +94,9 @@ There is NO WARRANTY, to the extent permitted by law.\n\
   switch (n_authors)
     {
     case 0:
-      /* The caller must provide at least one author name.  */
-      abort ();
+      /* No authors are given.  The caller should output authorship
+         info after calling this function.  */
+      break;
     case 1:
       /* TRANSLATORS: %s denotes an author name.  */
       fprintf (stream, _("Written by %s.\n"), authors[0]);