projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix autoreconf invocation.
[gnulib.git]
/
lib
/
savedir.c
diff --git
a/lib/savedir.c
b/lib/savedir.c
index
a1f8a6c
..
4eeda01
100644
(file)
--- a/
lib/savedir.c
+++ b/
lib/savedir.c
@@
-1,7
+1,7
@@
/* savedir.c -- save the list of files in a directory in a string
/* savedir.c -- save the list of files in a directory in a string
- Copyright 1990, 1997, 1998, 1999, 2000, 2001, 2003
Free Softwar
e
- Foundation, Inc.
+ Copyright 1990, 1997, 1998, 1999, 2000, 2001, 2003
, 2004, 2005 Fre
e
+
Software
Foundation, Inc.
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
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
@@
-15,7
+15,7
@@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
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., 5
9 Temple Place - Suite 330, Boston, MA 02111-1307
, USA. */
+ Inc., 5
1 Franklin Street, Fifth Floor, Boston, MA 02110-1301
, USA. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
@@
-23,12
+23,11
@@
# include <config.h>
#endif
# include <config.h>
#endif
+#include "savedir.h"
+
#include <sys/types.h>
#include <errno.h>
#include <sys/types.h>
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
#if HAVE_DIRENT_H
# include <dirent.h>
#if HAVE_DIRENT_H
# include <dirent.h>
@@
-52,16
+51,13
@@
extern int errno;
# define CLOSEDIR(d) closedir (d)
#endif
# define CLOSEDIR(d) closedir (d)
#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <string.h>
-#endif
#include <stddef.h>
#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
-#include "savedir.h"
#include "xalloc.h"
#include "xalloc.h"
-/* Return a freshly allocated string containing the filenames
+/* Return a freshly allocated string containing the file
names
in directory DIR, separated by '\0' characters;
the end is marked by two '\0' characters in a row.
Return NULL (setting errno) if DIR cannot be opened, read, or closed. */
in directory DIR, separated by '\0' characters;
the end is marked by two '\0' characters in a row.
Return NULL (setting errno) if DIR cannot be opened, read, or closed. */
@@
-90,7
+86,7
@@
savedir (const char *dir)
while ((dp = readdir (dirp)) != NULL)
{
/* Skip "", ".", and "..". "" is returned by at least one buggy
while ((dp = readdir (dirp)) != NULL)
{
/* Skip "", ".", and "..". "" is returned by at least one buggy
- implementation: Solaris 2.4 readdir on NFS filesystems. */
+ implementation: Solaris 2.4 readdir on NFS file
systems. */
char const *entry = dp->d_name;
if (entry[entry[0] != '.' ? 0 : entry[1] != '.' ? 1 : 2] != '\0')
{
char const *entry = dp->d_name;
if (entry[entry[0] != '.' ? 0 : entry[1] != '.' ? 1 : 2] != '\0')
{