[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] getusershell patch to assume C89 or better
From: |
Paul Eggert |
Subject: |
[Bug-gnulib] getusershell patch to assume C89 or better |
Date: |
09 Sep 2003 12:28:33 -0700 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
I installed this:
* lib/getusershell.c: Include <stdlib.h> unconditionally.
(getusershell, setusershell, endusershell, readname, main):
Define with prototypes.
* m4/getusershell.m4 (gl_PREREQ_GETUSERSHELL): Do not check for
stdlib.h.
Index: lib/getusershell.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/getusershell.c,v
retrieving revision 1.15
diff -p -u -r1.15 getusershell.c
--- lib/getusershell.c 14 Aug 2003 22:04:35 -0000 1.15
+++ lib/getusershell.c 9 Sep 2003 19:21:41 -0000
@@ -32,9 +32,7 @@
#endif
#include <stdio.h>
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
#include <ctype.h>
#include "unlocked-io.h"
#include "xalloc.h"
@@ -47,7 +45,7 @@
#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
-static int readname ();
+static int readname (char **, int *, FILE *);
#if ! defined ADDITIONAL_DEFAULT_SHELLS && defined __MSDOS__
# define ADDITIONAL_DEFAULT_SHELLS \
@@ -82,7 +80,7 @@ static int line_size = 0;
Return NULL if there are no more entries. */
char *
-getusershell ()
+getusershell (void)
{
if (default_index > 0)
{
@@ -114,7 +112,7 @@ getusershell ()
/* Rewind the shells file. */
void
-setusershell ()
+setusershell (void)
{
default_index = 0;
if (shellstream)
@@ -124,7 +122,7 @@ setusershell ()
/* Close the shells file. */
void
-endusershell ()
+endusershell (void)
{
if (shellstream)
{
@@ -142,10 +140,7 @@ endusershell ()
if some nonempty sequence was found, otherwise 0. */
static int
-readname (name, size, stream)
- char **name;
- int *size;
- FILE *stream;
+readname (char **name, int *size, FILE *stream)
{
int c;
int name_index = 0;
@@ -175,7 +170,8 @@ readname (name, size, stream)
}
#ifdef TEST
-main ()
+int
+main (void)
{
char *s;
Index: m4/getusershell.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/getusershell.m4,v
retrieving revision 1.1
diff -p -u -r1.1 getusershell.m4
--- m4/getusershell.m4 31 Dec 2002 13:42:07 -0000 1.1
+++ m4/getusershell.m4 9 Sep 2003 19:21:41 -0000
@@ -1,5 +1,5 @@
-# getusershell.m4 serial 1
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# getusershell.m4 serial 2
+dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
@@ -17,7 +17,6 @@ AC_DEFUN([gl_FUNC_GETUSERSHELL],
# Prerequisites of lib/getusershell.c.
AC_DEFUN([gl_PREREQ_GETUSERSHELL], [
AC_REQUIRE([AC_HEADER_STDC])
- AC_CHECK_HEADERS_ONCE(stdlib.h)
AC_CHECK_FUNCS_ONCE(isascii)
])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-gnulib] getusershell patch to assume C89 or better,
Paul Eggert <=