X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fgetusershell.c;h=fa1b1202dc9891fddfb32b2ab803bb5cbc81a771;hb=0600c3a06dc7495a7649234fe6e1ff813abeac02;hp=1b9a18a3c9105ca502ea0c726a0427e2b72ae4a8;hpb=267a39bafd249d7eb9c37df06dc6defcf41cb343;p=gnulib.git
diff --git a/lib/getusershell.c b/lib/getusershell.c
index 1b9a18a3c..fa1b1202d 100644
--- a/lib/getusershell.c
+++ b/lib/getusershell.c
@@ -1,12 +1,12 @@
/* getusershell.c -- Return names of valid user shells.
- Copyright (C) 1991, 1997, 2000, 2001, 2003, 2004, 2005 Free Software
- Foundation, Inc.
+ Copyright (C) 1991, 1997, 2000, 2001, 2003, 2004, 2005, 2006 Free
+ Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -14,14 +14,11 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program. If not, see . */
/* Written by David MacKenzie */
-#ifdef HAVE_CONFIG_H
-# include
-#endif
+#include
#ifndef SHELLS_FILE
# ifndef __DJGPP__
@@ -33,25 +30,16 @@
# endif
#endif
-#include
#include
#include
-#include "stdio-safer.h"
+#include "stdio--.h"
#include "xalloc.h"
#if USE_UNLOCKED_IO
# include "unlocked-io.h"
#endif
-#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
-# define IN_CTYPE_DOMAIN(c) 1
-#else
-# define IN_CTYPE_DOMAIN(c) isascii(c)
-#endif
-
-#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
-
static size_t readname (char **, size_t *, FILE *);
#if ! defined ADDITIONAL_DEFAULT_SHELLS && defined __MSDOS__
@@ -99,7 +87,7 @@ getusershell (void)
if (shellstream == NULL)
{
- shellstream = fopen_safer (SHELLS_FILE, "r");
+ shellstream = fopen (SHELLS_FILE, "r");
if (shellstream == NULL)
{
/* No shells file. Use the default list. */
@@ -153,14 +141,14 @@ readname (char **name, size_t *size, FILE *stream)
size_t name_index = 0;
/* Skip blank space. */
- while ((c = getc (stream)) != EOF && ISSPACE (c))
+ while ((c = getc (stream)) != EOF && isspace (c))
/* Do nothing. */ ;
for (;;)
{
if (*size <= name_index)
*name = x2nrealloc (*name, size, sizeof **name);
- if (c == EOF || ISSPACE (c))
+ if (c == EOF || isspace (c))
break;
(*name)[name_index++] = c;
c = getc (stream);