changeset 40046:cc26384787bc

version-etc: allow zero authors * 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.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 20 Dec 2018 16:10:29 -0800
parents 753e4de5f3eb
children 183a2f6b0b16
files ChangeLog lib/version-etc.c
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Dec 20 03:11:34 2018 +0100
+++ b/ChangeLog	Thu Dec 20 16:10:29 2018 -0800
@@ -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.
--- a/lib/version-etc.c	Thu Dec 20 03:11:34 2018 +0100
+++ b/lib/version-etc.c	Thu Dec 20 16:10:29 2018 -0800
@@ -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 @@
   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]);