summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/__fpending.c2
-rw-r--r--lib/__fpending.h4
-rw-r--r--lib/acl.c2
-rw-r--r--lib/argmatch.c2
-rw-r--r--lib/atexit.c4
-rw-r--r--lib/backupfile.c2
-rw-r--r--lib/basename.c2
-rw-r--r--lib/calloc.c2
-rw-r--r--lib/canonicalize.c13
-rw-r--r--lib/chdir-long.c4
-rw-r--r--lib/chown.c4
-rw-r--r--lib/cloexec.c5
-rw-r--r--lib/closeout.c2
-rw-r--r--lib/creat-safer.c2
-rw-r--r--lib/cycle-check.c2
-rw-r--r--lib/dirfd.c2
-rw-r--r--lib/dirfd.h4
-rw-r--r--lib/dirname.c2
-rw-r--r--lib/dup-safer.c2
-rw-r--r--lib/dup2.c6
-rw-r--r--lib/euidaccess.c2
-rw-r--r--lib/exclude.c3
-rw-r--r--lib/exitfail.c2
-rw-r--r--lib/fchown-stub.c4
-rw-r--r--lib/fd-safer.c2
-rw-r--r--lib/file-type.c2
-rw-r--r--lib/fileblocks.c5
-rw-r--r--lib/filemode.c2
-rw-r--r--lib/filenamecat.c2
-rw-r--r--lib/fnmatch.c2
-rw-r--r--lib/fopen-safer.c2
-rw-r--r--lib/free.c2
-rw-r--r--lib/fsusage.c2
-rw-r--r--lib/ftruncate.c2
-rw-r--r--lib/full-write.c2
-rw-r--r--lib/getcwd.c2
-rw-r--r--lib/getcwd.h4
-rw-r--r--lib/getdate.h4
-rw-r--r--lib/getgroups.c4
-rw-r--r--lib/getndelim2.c2
-rw-r--r--lib/getopt1.c2
-rw-r--r--lib/getopt_.h2
-rw-r--r--lib/gettimeofday.c4
-rw-r--r--lib/getugroups.c2
-rw-r--r--lib/group-member.c4
-rw-r--r--lib/hard-locale.c2
-rw-r--r--lib/hash-pjw.c2
-rw-r--r--lib/hash.c2
-rw-r--r--lib/human.c2
-rw-r--r--lib/human.h4
-rw-r--r--lib/idcache.c2
-rw-r--r--lib/inttostr.c3
-rw-r--r--lib/inttostr.h8
-rw-r--r--lib/lchown.c4
-rw-r--r--lib/long-options.c2
-rw-r--r--lib/lstat.c4
-rw-r--r--lib/malloc.c2
-rw-r--r--lib/memcasecmp.c2
-rw-r--r--lib/memchr.c5
-rw-r--r--lib/memcmp.c2
-rw-r--r--lib/memcoll.c2
-rw-r--r--lib/memcpy.c2
-rw-r--r--lib/memmove.c2
-rw-r--r--lib/mkdir.c4
-rw-r--r--lib/mkstemp.c4
-rw-r--r--lib/mktime.c3
-rw-r--r--lib/modechange.c2
-rw-r--r--lib/mountlist.c2
-rw-r--r--lib/nanosleep.c4
-rw-r--r--lib/open-safer.c2
-rw-r--r--lib/openat.c4
-rw-r--r--lib/physmem.c4
-rw-r--r--lib/pipe-safer.c2
-rw-r--r--lib/posixtm.c7
-rw-r--r--lib/posixver.c4
-rw-r--r--lib/putenv.c2
-rw-r--r--lib/quote.c2
-rw-r--r--lib/quotearg.c11
-rw-r--r--lib/raise.c6
-rw-r--r--lib/readlink.c2
-rw-r--r--lib/readtokens0.c4
-rw-r--r--lib/readutmp.c4
-rw-r--r--lib/realloc.c2
-rw-r--r--lib/regex.c2
-rw-r--r--lib/regex_internal.h18
-rw-r--r--lib/rename.c2
-rw-r--r--lib/rmdir.c2
-rw-r--r--lib/rpmatch.c2
-rw-r--r--lib/safe-read.c4
-rw-r--r--lib/same.c2
-rw-r--r--lib/save-cwd.c4
-rw-r--r--lib/savedir.c2
-rw-r--r--lib/settime.c2
-rw-r--r--lib/sig2str.c2
-rw-r--r--lib/strcspn.c2
-rw-r--r--lib/stripslash.c2
-rw-r--r--lib/strndup.c12
-rw-r--r--lib/strnlen.c2
-rw-r--r--lib/strtod.c2
-rw-r--r--lib/strtoimax.c2
-rw-r--r--lib/strtol.c2
-rw-r--r--lib/strverscmp.c2
-rw-r--r--lib/tempname.c2
-rw-r--r--lib/time_r.c2
-rw-r--r--lib/time_r.h13
-rw-r--r--lib/timespec.h2
-rw-r--r--lib/unicodeio.h15
-rw-r--r--lib/unistd--.h3
-rw-r--r--lib/unlinkdir.c4
-rw-r--r--lib/userspec.c2
-rw-r--r--lib/utimecmp.c2
-rw-r--r--lib/version-etc-fsf.c2
-rw-r--r--lib/version-etc.c2
-rw-r--r--lib/xalloc-die.c2
-rw-r--r--lib/xgetcwd.c2
-rw-r--r--lib/xgethostname.c1
-rw-r--r--lib/xmalloc.c2
-rw-r--r--lib/xmemcoll.c2
-rw-r--r--lib/xnanosleep.c2
-rw-r--r--lib/xreadlink.c2
-rw-r--r--lib/xstrndup.c2
-rw-r--r--lib/xstrtoimax.c2
-rw-r--r--lib/xstrtol.c2
-rw-r--r--lib/xstrtoumax.c2
-rw-r--r--lib/yesno.c2
125 files changed, 220 insertions, 181 deletions
diff --git a/lib/__fpending.c b/lib/__fpending.c
index 0769f2314..63fb7d7cc 100644
--- a/lib/__fpending.c
+++ b/lib/__fpending.c
@@ -17,7 +17,7 @@
/* Written by Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/__fpending.h b/lib/__fpending.h
index 5a5158216..36a842ed5 100644
--- a/lib/__fpending.h
+++ b/lib/__fpending.h
@@ -1,7 +1,3 @@
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#include <stddef.h>
#include <stdio.h>
diff --git a/lib/acl.c b/lib/acl.c
index 47b73bd23..293582514 100644
--- a/lib/acl.c
+++ b/lib/acl.c
@@ -18,7 +18,7 @@
Written by Paul Eggert. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/argmatch.c b/lib/argmatch.c
index db883ac41..36d5845ac 100644
--- a/lib/argmatch.c
+++ b/lib/argmatch.c
@@ -20,7 +20,7 @@
/* Written by David MacKenzie <djm@ai.mit.edu>
Modified by Akim Demaille <demaille@inf.enst.fr> */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/atexit.c b/lib/atexit.c
index a401b2ff8..f4873c9ee 100644
--- a/lib/atexit.c
+++ b/lib/atexit.c
@@ -1,7 +1,9 @@
/* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */
/* This function is in the public domain. --Mike Stump. */
-#include "config.h"
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
int
atexit (void (*f) (void))
diff --git a/lib/backupfile.c b/lib/backupfile.c
index 35dde4647..32ffaeaa7 100644
--- a/lib/backupfile.c
+++ b/lib/backupfile.c
@@ -21,7 +21,7 @@
/* Written by Paul Eggert and David MacKenzie.
Some algorithms adapted from GNU Emacs. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/basename.c b/lib/basename.c
index 00adc0015..5cc97cd4a 100644
--- a/lib/basename.c
+++ b/lib/basename.c
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/calloc.c b/lib/calloc.c
index 9edbf4552..317b4fff4 100644
--- a/lib/calloc.c
+++ b/lib/calloc.c
@@ -18,7 +18,7 @@
/* written by Jim Meyering */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#undef calloc
diff --git a/lib/canonicalize.c b/lib/canonicalize.c
index b4d4c445b..84368a493 100644
--- a/lib/canonicalize.c
+++ b/lib/canonicalize.c
@@ -22,17 +22,8 @@
#include "canonicalize.h"
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-#else
-void free ();
-#endif
-
-#if defined STDC_HEADERS || defined HAVE_STRING_H
-# include <string.h>
-#else
-# include <strings.h>
-#endif
+#include <stdlib.h>
+#include <string.h>
#if HAVE_SYS_PARAM_H
# include <sys/param.h>
diff --git a/lib/chdir-long.c b/lib/chdir-long.c
index 2cc70fa53..a72781725 100644
--- a/lib/chdir-long.c
+++ b/lib/chdir-long.c
@@ -17,7 +17,9 @@
/* written by Jim Meyering */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include "chdir-long.h"
diff --git a/lib/chown.c b/lib/chown.c
index d6c64a48b..729dd3b0b 100644
--- a/lib/chown.c
+++ b/lib/chown.c
@@ -18,7 +18,9 @@
/* written by Jim Meyering */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
/* Disable the definition of chown to rpl_chown (from config.h) in this
file. Otherwise, we'd get conflicting prototypes for rpl_chown on
diff --git a/lib/cloexec.c b/lib/cloexec.c
index cfffa53b8..cf2308ca1 100644
--- a/lib/cloexec.c
+++ b/lib/cloexec.c
@@ -1,5 +1,5 @@
/* closexec.c - set or clear the close-on-exec descriptor flag
- Copyright (C) 1991, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1991, 2004, 2005 Free 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
@@ -17,14 +17,13 @@
The code is taken from glibc/manual/llio.texi */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "cloexec.h"
#include <unistd.h>
-
#include <fcntl.h>
#ifndef FD_CLOEXEC
diff --git a/lib/closeout.c b/lib/closeout.c
index fb7d2bb42..5d0509ded 100644
--- a/lib/closeout.c
+++ b/lib/closeout.c
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/creat-safer.c b/lib/creat-safer.c
index 8241c69b0..4588de399 100644
--- a/lib/creat-safer.c
+++ b/lib/creat-safer.c
@@ -17,7 +17,7 @@
/* Written by Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/cycle-check.c b/lib/cycle-check.c
index 1c6e17cac..401dd862f 100644
--- a/lib/cycle-check.c
+++ b/lib/cycle-check.c
@@ -19,7 +19,7 @@
/* Written by Jim Meyering */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/dirfd.c b/lib/dirfd.c
index d65a35c3e..18d5e1e5d 100644
--- a/lib/dirfd.c
+++ b/lib/dirfd.c
@@ -17,7 +17,7 @@
/* Written by Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/dirfd.h b/lib/dirfd.h
index ce5ab2903..1223b51d2 100644
--- a/lib/dirfd.h
+++ b/lib/dirfd.h
@@ -17,10 +17,6 @@
Written by Jim Meyering. */
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#include <sys/types.h>
#if HAVE_DIRENT_H
diff --git a/lib/dirname.c b/lib/dirname.c
index f1930c8d2..e2b9d648c 100644
--- a/lib/dirname.c
+++ b/lib/dirname.c
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/dup-safer.c b/lib/dup-safer.c
index 1c46b6e72..8cbee7007 100644
--- a/lib/dup-safer.c
+++ b/lib/dup-safer.c
@@ -17,7 +17,7 @@
/* Written by Paul Eggert. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/dup2.c b/lib/dup2.c
index 315c82b15..f581d855d 100644
--- a/lib/dup2.c
+++ b/lib/dup2.c
@@ -1,5 +1,5 @@
/* Duplicate an open file descriptor to a specified file descriptor.
- Copyright (C) 1999, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2004, 2005 Free 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
@@ -17,14 +17,12 @@
/* written by Paul Eggert */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <errno.h>
-
#include <fcntl.h>
-
#include <unistd.h>
#ifndef F_DUPFD
diff --git a/lib/euidaccess.c b/lib/euidaccess.c
index 4e1260b25..44c5a07bc 100644
--- a/lib/euidaccess.c
+++ b/lib/euidaccess.c
@@ -22,7 +22,7 @@
/* Written by David MacKenzie and Torbjorn Granlund.
Adapted for GNU C library by Roland McGrath. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/exclude.c b/lib/exclude.c
index 955c28956..de1a5c3f3 100644
--- a/lib/exclude.c
+++ b/lib/exclude.c
@@ -20,7 +20,7 @@
/* Written by Paul Eggert <eggert@twinsun.com> */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@@ -35,6 +35,7 @@
#include "exclude.h"
#include "fnmatch.h"
+#include "strcase.h"
#include "xalloc.h"
#if USE_UNLOCKED_IO
diff --git a/lib/exitfail.c b/lib/exitfail.c
index 1c5997b8a..27d38c32a 100644
--- a/lib/exitfail.c
+++ b/lib/exitfail.c
@@ -17,7 +17,7 @@
If not, write to the Free Software Foundation,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/fchown-stub.c b/lib/fchown-stub.c
index beb336caf..322baccce 100644
--- a/lib/fchown-stub.c
+++ b/lib/fchown-stub.c
@@ -1,4 +1,6 @@
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <sys/types.h>
#include <errno.h>
diff --git a/lib/fd-safer.c b/lib/fd-safer.c
index 6b5045133..5933bcbd1 100644
--- a/lib/fd-safer.c
+++ b/lib/fd-safer.c
@@ -18,7 +18,7 @@
/* Written by Paul Eggert. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/file-type.c b/lib/file-type.c
index 0a6c3ee77..4b811903f 100644
--- a/lib/file-type.c
+++ b/lib/file-type.c
@@ -19,7 +19,7 @@
/* Written by Paul Eggert. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/fileblocks.c b/lib/fileblocks.c
index 9367176e3..9a10cc222 100644
--- a/lib/fileblocks.c
+++ b/lib/fileblocks.c
@@ -1,6 +1,7 @@
/* Convert file size to number of blocks on System V-like machines.
- Copyright (C) 1990, 1997, 1998, 1999, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1997, 1998, 1999, 2004, 2005 Free 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
@@ -18,7 +19,7 @@
/* Written by Brian L. Matthews, blm@6sceng.UUCP. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/filemode.c b/lib/filemode.c
index a5485b401..08b9b13bb 100644
--- a/lib/filemode.c
+++ b/lib/filemode.c
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/filenamecat.c b/lib/filenamecat.c
index f56697a6d..f94734630 100644
--- a/lib/filenamecat.c
+++ b/lib/filenamecat.c
@@ -19,7 +19,7 @@
/* Written by Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/fnmatch.c b/lib/fnmatch.c
index ad66ce89e..06416f6ee 100644
--- a/lib/fnmatch.c
+++ b/lib/fnmatch.c
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/fopen-safer.c b/lib/fopen-safer.c
index ccaf1219f..4f2ffa1b8 100644
--- a/lib/fopen-safer.c
+++ b/lib/fopen-safer.c
@@ -17,7 +17,7 @@
/* Written by Paul Eggert. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/free.c b/lib/free.c
index 9e3435640..597088d4e 100644
--- a/lib/free.c
+++ b/lib/free.c
@@ -18,7 +18,7 @@
/* written by Paul Eggert */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#undef free
diff --git a/lib/fsusage.c b/lib/fsusage.c
index 81c28690f..b13779073 100644
--- a/lib/fsusage.c
+++ b/lib/fsusage.c
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/ftruncate.c b/lib/ftruncate.c
index 669d59490..4bfa43173 100644
--- a/lib/ftruncate.c
+++ b/lib/ftruncate.c
@@ -1,7 +1,7 @@
/* ftruncate emulations that work on some System V's.
This file is in the public domain. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/full-write.c b/lib/full-write.c
index 962602742..106f3c7e5 100644
--- a/lib/full-write.c
+++ b/lib/full-write.c
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/getcwd.c b/lib/getcwd.c
index be10e4f1b..666310a7e 100644
--- a/lib/getcwd.c
+++ b/lib/getcwd.c
@@ -17,7 +17,7 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
-# include "config.h"
+# include <config.h>
#endif
#if !_LIBC
diff --git a/lib/getcwd.h b/lib/getcwd.h
index 0503ff824..59606ddc2 100644
--- a/lib/getcwd.h
+++ b/lib/getcwd.h
@@ -1,6 +1,6 @@
/* Get the working directory, compatibly with the GNU C Library.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004-2005 Free 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
@@ -34,5 +34,7 @@
# define __GETCWD_XCONCAT(x, y) __GETCWD_CONCAT (x, y)
# define __GETCWD_ID(y) __GETCWD_XCONCAT (__GETCWD_PREFIX, y)
# define getcwd __GETCWD_ID (getcwd)
+/* See the POSIX:2001 specification
+ <http://www.opengroup.org/susv3xsh/getcwd.html>. */
char *getcwd (char *, size_t);
#endif
diff --git a/lib/getdate.h b/lib/getdate.h
index dd97807a7..4694cdb66 100644
--- a/lib/getdate.h
+++ b/lib/getdate.h
@@ -16,10 +16,6 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#include <stdbool.h>
#include "timespec.h"
diff --git a/lib/getgroups.c b/lib/getgroups.c
index 084d1f828..126f130a0 100644
--- a/lib/getgroups.c
+++ b/lib/getgroups.c
@@ -17,7 +17,9 @@
/* written by Jim Meyering */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <stdio.h>
#include <sys/types.h>
#include <errno.h>
diff --git a/lib/getndelim2.c b/lib/getndelim2.c
index e9f8cb9c5..3c0fa3f05 100644
--- a/lib/getndelim2.c
+++ b/lib/getndelim2.c
@@ -20,7 +20,7 @@
/* Originally written by Jan Brittenson, bson@gnu.ai.mit.edu. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/getopt1.c b/lib/getopt1.c
index 5acd2245a..25d792650 100644
--- a/lib/getopt1.c
+++ b/lib/getopt1.c
@@ -18,7 +18,7 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
#endif
#ifdef _LIBC
diff --git a/lib/getopt_.h b/lib/getopt_.h
index 0cf7b8ad3..3c406e53d 100644
--- a/lib/getopt_.h
+++ b/lib/getopt_.h
@@ -1,5 +1,5 @@
/* Declarations for getopt.
- Copyright (C) 1989-1994,1996-1999,2001,2003,2004
+ Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005
Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c
index f9afc22c1..eb6de94f1 100644
--- a/lib/gettimeofday.c
+++ b/lib/gettimeofday.c
@@ -20,7 +20,9 @@
/* written by Jim Meyering */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
/* Disable the definitions of these functions (from config.h)
so we can use the library versions here. */
diff --git a/lib/getugroups.c b/lib/getugroups.c
index 60b04682a..7aa540db7 100644
--- a/lib/getugroups.c
+++ b/lib/getugroups.c
@@ -1,6 +1,6 @@
/* getugroups.c -- return a list of the groups a user is in
- Copyright (C) 1990, 1991, 1998, 1999, 2000, 2003, 2004 Free
+ Copyright (C) 1990, 1991, 1998, 1999, 2000, 2003, 2004, 2005 Free
Software Foundation.
This program is free software; you can redistribute it and/or modify
diff --git a/lib/group-member.c b/lib/group-member.c
index a338674b2..7b189f241 100644
--- a/lib/group-member.c
+++ b/lib/group-member.c
@@ -1,5 +1,5 @@
/* group-member.c -- determine whether group id is in calling user's group list
- Copyright (C) 1994, 1997, 1998, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1997, 1998, 2003, 2005 Free 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
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/hard-locale.c b/lib/hard-locale.c
index b0566ec21..98530fcd5 100644
--- a/lib/hard-locale.c
+++ b/lib/hard-locale.c
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/hash-pjw.c b/lib/hash-pjw.c
index 76b4db5c7..315277abb 100644
--- a/lib/hash-pjw.c
+++ b/lib/hash-pjw.c
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/hash.c b/lib/hash.c
index 2b5d5c255..f85bd519b 100644
--- a/lib/hash.c
+++ b/lib/hash.c
@@ -24,7 +24,7 @@
/* Define USE_OBSTACK to 1 if you want the allocator to use obstacks instead
of malloc. If you change USE_OBSTACK, you have to recompile! */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/human.c b/lib/human.c
index 282a3236f..ed15c6a24 100644
--- a/lib/human.c
+++ b/lib/human.c
@@ -19,7 +19,7 @@
/* Written by Paul Eggert and Larry McVoy. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/human.h b/lib/human.h
index 15ca36bf8..902d59935 100644
--- a/lib/human.h
+++ b/lib/human.h
@@ -22,10 +22,6 @@
#ifndef HUMAN_H_
# define HUMAN_H_ 1
-# if HAVE_CONFIG_H
-# include <config.h>
-# endif
-
# include <limits.h>
# include <stdbool.h>
diff --git a/lib/idcache.c b/lib/idcache.c
index 0673d80fc..2e46c1b04 100644
--- a/lib/idcache.c
+++ b/lib/idcache.c
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/inttostr.c b/lib/inttostr.c
index 23748a137..2adcd2c13 100644
--- a/lib/inttostr.c
+++ b/lib/inttostr.c
@@ -18,6 +18,9 @@
/* Written by Paul Eggert */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include "inttostr.h"
/* Convert I to a printable string in BUF, which must be at least
diff --git a/lib/inttostr.h b/lib/inttostr.h
index 952da97b6..55f80ee8e 100644
--- a/lib/inttostr.h
+++ b/lib/inttostr.h
@@ -18,10 +18,6 @@
/* Written by Paul Eggert */
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
@@ -29,9 +25,7 @@
# include <stdint.h>
#endif
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
#include "intprops.h"
diff --git a/lib/lchown.c b/lib/lchown.c
index ff5679e7f..0b74eac8a 100644
--- a/lib/lchown.c
+++ b/lib/lchown.c
@@ -17,7 +17,9 @@
/* written by Jim Meyering */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/lib/long-options.c b/lib/long-options.c
index 33f1d4627..7c9972a19 100644
--- a/lib/long-options.c
+++ b/lib/long-options.c
@@ -19,7 +19,7 @@
/* Written by Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/lstat.c b/lib/lstat.c
index 0d539fe4a..f5a22b07b 100644
--- a/lib/lstat.c
+++ b/lib/lstat.c
@@ -19,7 +19,9 @@
/* written by Jim Meyering */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
/* The specification of these functions is in sys_stat.h. But we cannot
include this include file here, because on some systems, a
diff --git a/lib/malloc.c b/lib/malloc.c
index a75da9b79..58fa61168 100644
--- a/lib/malloc.c
+++ b/lib/malloc.c
@@ -17,7 +17,7 @@
/* written by Jim Meyering */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#undef malloc
diff --git a/lib/memcasecmp.c b/lib/memcasecmp.c
index 00519f51a..b0a492590 100644
--- a/lib/memcasecmp.c
+++ b/lib/memcasecmp.c
@@ -17,7 +17,7 @@
/* Written by Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/memchr.c b/lib/memchr.c
index c4f24301c..3c5ecfd0e 100644
--- a/lib/memchr.c
+++ b/lib/memchr.c
@@ -21,9 +21,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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, write to the Free Software Foundation,
+Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
# include <config.h>
diff --git a/lib/memcmp.c b/lib/memcmp.c
index ca68658f3..6928b1e4a 100644
--- a/lib/memcmp.c
+++ b/lib/memcmp.c
@@ -22,7 +22,7 @@
USA. */
#ifdef HAVE_CONFIG_H
-# include "config.h"
+# include <config.h>
#endif
#include <string.h>
diff --git a/lib/memcoll.c b/lib/memcoll.c
index d9504b453..82d889f40 100644
--- a/lib/memcoll.c
+++ b/lib/memcoll.c
@@ -17,7 +17,7 @@
/* Contributed by Paul Eggert <eggert@twinsun.com>. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/memcpy.c b/lib/memcpy.c
index 09fb55d21..2ab5ed6ee 100644
--- a/lib/memcpy.c
+++ b/lib/memcpy.c
@@ -16,7 +16,7 @@
/* Written by Jim Meyering <meyering@na-net.ornl.gov>. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/memmove.c b/lib/memmove.c
index 79cc78273..753c899d3 100644
--- a/lib/memmove.c
+++ b/lib/memmove.c
@@ -3,7 +3,7 @@
In the public domain.
By David MacKenzie <djm@gnu.ai.mit.edu>. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/mkdir.c b/lib/mkdir.c
index 807f322e5..c921ecfdb 100644
--- a/lib/mkdir.c
+++ b/lib/mkdir.c
@@ -19,7 +19,9 @@
/* written by Jim Meyering */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
/* Disable the definition of mkdir to rpl_mkdir (from config.h) in this
file. Otherwise, we'd get conflicting prototypes for rpl_mkdir on
diff --git a/lib/mkstemp.c b/lib/mkstemp.c
index 2683e4b8f..cec5ba8ba 100644
--- a/lib/mkstemp.c
+++ b/lib/mkstemp.c
@@ -15,7 +15,9 @@
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
/* Disable the definition of mkstemp to rpl_mkstemp (from config.h) in this
file. Otherwise, we'd get conflicting prototypes for rpl_mkstemp on
diff --git a/lib/mktime.c b/lib/mktime.c
index e5f25d984..b2d9e52e4 100644
--- a/lib/mktime.c
+++ b/lib/mktime.c
@@ -1,6 +1,5 @@
/* Convert a `struct tm' to a time_t value.
Copyright (C) 1993-1999, 2002-2004, 2005 Free Software Foundation, Inc.
- Inc.
This file is part of the GNU C Library.
Contributed by Paul Eggert (eggert@twinsun.com).
@@ -16,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,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Define this to have a standalone program to test this implementation of
mktime. */
diff --git a/lib/modechange.c b/lib/modechange.c
index a2697f67f..6ab9cb6fd 100644
--- a/lib/modechange.c
+++ b/lib/modechange.c
@@ -26,7 +26,7 @@
changing the mode of many files, this probably results in a
performance gain. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/mountlist.c b/lib/mountlist.c
index da39daaef..6c4e2b9d3 100644
--- a/lib/mountlist.c
+++ b/lib/mountlist.c
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/nanosleep.c b/lib/nanosleep.c
index 97d60d864..61fc1b90b 100644
--- a/lib/nanosleep.c
+++ b/lib/nanosleep.c
@@ -17,7 +17,9 @@
/* written by Jim Meyering */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
/* Undefine nanosleep here so any prototype is not redefined to be a
prototype for rpl_nanosleep. (they'd conflict e.g., on alpha-dec-osf3.2) */
diff --git a/lib/open-safer.c b/lib/open-safer.c
index c7800a395..d3ba894ac 100644
--- a/lib/open-safer.c
+++ b/lib/open-safer.c
@@ -17,7 +17,7 @@
/* Written by Paul Eggert. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/openat.c b/lib/openat.c
index ea42ec26b..f7eb39d0e 100644
--- a/lib/openat.c
+++ b/lib/openat.c
@@ -17,7 +17,9 @@
/* written by Jim Meyering */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include "openat.h"
diff --git a/lib/physmem.c b/lib/physmem.c
index 99fc8465b..ad8594d28 100644
--- a/lib/physmem.c
+++ b/lib/physmem.c
@@ -1,5 +1,5 @@
/* Calculate the size of physical memory.
- Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2003, 2005 Free 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
@@ -17,7 +17,7 @@
/* Written by Paul Eggert. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/pipe-safer.c b/lib/pipe-safer.c
index 579165765..fb02d7217 100644
--- a/lib/pipe-safer.c
+++ b/lib/pipe-safer.c
@@ -17,7 +17,7 @@
/* Written by Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/posixtm.c b/lib/posixtm.c
index 397f63f46..85936f3c6 100644
--- a/lib/posixtm.c
+++ b/lib/posixtm.c
@@ -43,13 +43,6 @@
# include "unlocked-io.h"
#endif
-/* Use this to suppress gcc's `...may be used before initialized' warnings. */
-#ifdef lint
-# define IF_LINT(Code) Code
-#else
-# define IF_LINT(Code) /* empty */
-#endif
-
/* ISDIGIT differs from isdigit, as follows:
- Its arg may be any int or unsigned int; it need not be an unsigned char.
- It's guaranteed to evaluate its argument exactly once.
diff --git a/lib/posixver.c b/lib/posixver.c
index 7fd7cd3b8..0e75676f9 100644
--- a/lib/posixver.c
+++ b/lib/posixver.c
@@ -1,6 +1,6 @@
/* Which POSIX version to conform to, for utilities.
- Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005 Free 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
@@ -18,7 +18,7 @@
/* Written by Paul Eggert. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/putenv.c b/lib/putenv.c
index 0a23694fa..9c7cf66ee 100644
--- a/lib/putenv.c
+++ b/lib/putenv.c
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/quote.c b/lib/quote.c
index 4c75029a3..16cc939c1 100644
--- a/lib/quote.c
+++ b/lib/quote.c
@@ -17,7 +17,7 @@
/* Written by Paul Eggert <eggert@twinsun.com> */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/quotearg.c b/lib/quotearg.c
index a66f882b0..1d1b54395 100644
--- a/lib/quotearg.c
+++ b/lib/quotearg.c
@@ -19,7 +19,7 @@
/* Written by Paul Eggert <eggert@twinsun.com> */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@@ -222,7 +222,8 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
case locale_quoting_style:
case clocale_quoting_style:
{
- /* Get translations for open and closing quotation marks.
+ /* TRANSLATORS:
+ Get translations for open and closing quotation marks.
The message catalog should translate "`" to a left
quotation mark suitable for the locale, and similarly for
@@ -235,7 +236,11 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
should translate "'" to U+201D (RIGHT DOUBLE QUOTATION
MARK). A British English Unicode locale should instead
translate these to U+2018 (LEFT SINGLE QUOTATION MARK) and
- U+2019 (RIGHT SINGLE QUOTATION MARK), respectively. */
+ U+2019 (RIGHT SINGLE QUOTATION MARK), respectively.
+
+ If you don't know what to put here, please see
+ <http://en.wikipedia.org/wiki/Quotation_mark#Glyphs>
+ and use glyphs suitable for your language. */
char const *left = gettext_quote (N_("`"), quoting_style);
char const *right = gettext_quote (N_("'"), quoting_style);
diff --git a/lib/raise.c b/lib/raise.c
index 1225f764e..0c1464064 100644
--- a/lib/raise.c
+++ b/lib/raise.c
@@ -1,5 +1,5 @@
/* Provide a non-threads replacement for the POSIX raise function.
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2005 Free 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
@@ -17,7 +17,9 @@
/* written by Jim Meyering */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <sys/types.h>
#include <signal.h>
diff --git a/lib/readlink.c b/lib/readlink.c
index bf8a5f783..3196aecb0 100644
--- a/lib/readlink.c
+++ b/lib/readlink.c
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/readtokens0.c b/lib/readtokens0.c
index 494e08d55..55b39a747 100644
--- a/lib/readtokens0.c
+++ b/lib/readtokens0.c
@@ -17,7 +17,9 @@
Written by Jim Meyering. */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <stdlib.h>
#include "readtokens0.h"
diff --git a/lib/readutmp.c b/lib/readutmp.c
index 846ab3c6a..634d9ab1f 100644
--- a/lib/readutmp.c
+++ b/lib/readutmp.c
@@ -17,7 +17,9 @@
/* Written by jla; revised by djm */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include "readutmp.h"
diff --git a/lib/realloc.c b/lib/realloc.c
index df570aa63..fe9482223 100644
--- a/lib/realloc.c
+++ b/lib/realloc.c
@@ -17,7 +17,7 @@
/* written by Jim Meyering */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#undef realloc
diff --git a/lib/regex.c b/lib/regex.c
index 1bfdd6b9c..82e76c091 100644
--- a/lib/regex.c
+++ b/lib/regex.c
@@ -18,7 +18,7 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
-#include "config.h"
+# include <config.h>
#endif
#ifdef _LIBC
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index 02087592b..95df77cac 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -27,6 +27,10 @@
#include <stdlib.h>
#include <string.h>
+#ifndef _LIBC
+# include "strcase.h"
+#endif
+
#if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC
# include <langinfo.h>
#endif
@@ -84,11 +88,25 @@
# define RE_ENABLE_I18N
#endif
+#ifndef __GNUC_PREREQ
+# if defined __GNUC__ && defined __GNUC_MINOR__
+# define __GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+# else
+# define __GNUC_PREREQ(maj, min) 0
+# endif
+#endif
+
+#if !__GNUC_PREREQ (3, 1)
+# define always_inline
+#endif
+
#if __GNUC__ >= 3
# define BE(expr, val) __builtin_expect (expr, val)
#else
# define BE(expr, val) (expr)
# define inline
+# define pure
#endif
/* Number of single byte character. */
diff --git a/lib/rename.c b/lib/rename.c
index 6f77fd09c..9c9e7f4df 100644
--- a/lib/rename.c
+++ b/lib/rename.c
@@ -19,7 +19,7 @@
/* written by Volker Borchert */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#undef rename
diff --git a/lib/rmdir.c b/lib/rmdir.c
index ad026a641..25564b6b4 100644
--- a/lib/rmdir.c
+++ b/lib/rmdir.c
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/rpmatch.c b/lib/rpmatch.c
index 3e3a38ecf..ba8bc4ce9 100644
--- a/lib/rpmatch.c
+++ b/lib/rpmatch.c
@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/safe-read.c b/lib/safe-read.c
index a5108356d..9caf84666 100644
--- a/lib/safe-read.c
+++ b/lib/safe-read.c
@@ -1,6 +1,6 @@
/* An interface to read and write that retries after interrupts.
- Copyright (C) 1993, 1994, 1998, 2002, 2003, 2004 Free Software
+ Copyright (C) 1993, 1994, 1998, 2002, 2003, 2004, 2005 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/same.c b/lib/same.c
index 9cbf47a76..4854b3a97 100644
--- a/lib/same.c
+++ b/lib/same.c
@@ -19,7 +19,7 @@
/* written by Jim Meyering */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/save-cwd.c b/lib/save-cwd.c
index 1e988175b..4ff600e58 100644
--- a/lib/save-cwd.c
+++ b/lib/save-cwd.c
@@ -19,8 +19,8 @@
/* Written by Jim Meyering. */
-#if HAVE_CONFIG_H
-# include "config.h"
+#ifdef HAVE_CONFIG_H
+# include <config.h>
#endif
#include "save-cwd.h"
diff --git a/lib/savedir.c b/lib/savedir.c
index 4eeda0193..a2cf2f678 100644
--- a/lib/savedir.c
+++ b/lib/savedir.c
@@ -19,7 +19,7 @@
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/settime.c b/lib/settime.c
index 20edeab28..76bf70632 100644
--- a/lib/settime.c
+++ b/lib/settime.c
@@ -1,5 +1,5 @@
/* settime -- set the system clock
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2005 Free 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
diff --git a/lib/sig2str.c b/lib/sig2str.c
index 25ea5f310..00089be78 100644
--- a/lib/sig2str.c
+++ b/lib/sig2str.c
@@ -18,7 +18,7 @@
/* Written by Paul Eggert. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/strcspn.c b/lib/strcspn.c
index 7f60620b3..9fbc5de49 100644
--- a/lib/strcspn.c
+++ b/lib/strcspn.c
@@ -18,7 +18,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/stripslash.c b/lib/stripslash.c
index 870a66f38..9b55da48e 100644
--- a/lib/stripslash.c
+++ b/lib/stripslash.c
@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/strndup.c b/lib/strndup.c
index 366a4eb57..9ac2756a2 100644
--- a/lib/strndup.c
+++ b/lib/strndup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2000, 2003, 2005 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
@@ -18,18 +18,14 @@
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
-# include "config.h"
+# include <config.h>
#endif
#include <stdlib.h>
#include <string.h>
-#ifndef HAVE_DECL_STRNLEN
-"this configure-time declaration test was not run"
-#endif
-#if !HAVE_DECL_STRNLEN
-size_t strnlen ();
-#endif
+/* Get strnlen. */
+#include "strnlen.h"
#undef __strndup
#undef strndup
diff --git a/lib/strnlen.c b/lib/strnlen.c
index 642c66fac..97a1f810c 100644
--- a/lib/strnlen.c
+++ b/lib/strnlen.c
@@ -16,7 +16,7 @@
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#undef strnlen
diff --git a/lib/strtod.c b/lib/strtod.c
index 79a82f29e..7b48754e4 100644
--- a/lib/strtod.c
+++ b/lib/strtod.c
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/strtoimax.c b/lib/strtoimax.c
index 4724195ac..43a690d24 100644
--- a/lib/strtoimax.c
+++ b/lib/strtoimax.c
@@ -19,7 +19,7 @@
/* Written by Paul Eggert. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/strtol.c b/lib/strtol.c
index 778898159..9bfbe3c1a 100644
--- a/lib/strtol.c
+++ b/lib/strtol.c
@@ -20,7 +20,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/strverscmp.c b/lib/strverscmp.c
index 900c637dd..6276bca0f 100644
--- a/lib/strverscmp.c
+++ b/lib/strverscmp.c
@@ -17,7 +17,7 @@
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/tempname.c b/lib/tempname.c
index 27663c23c..3c9f59b32 100644
--- a/lib/tempname.c
+++ b/lib/tempname.c
@@ -17,7 +17,7 @@
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/time_r.c b/lib/time_r.c
index 1298728ba..245ac924b 100644
--- a/lib/time_r.c
+++ b/lib/time_r.c
@@ -18,7 +18,7 @@
/* Written by Paul Eggert. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/time_r.h b/lib/time_r.h
index f8d5d5293..1f2e94a90 100644
--- a/lib/time_r.h
+++ b/lib/time_r.h
@@ -1,6 +1,6 @@
/* Reentrant time functions like localtime_r.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2005 Free 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
@@ -37,9 +37,20 @@
# define gmtime_r rpl_gmtime_r
# define localtime_r rpl_localtime_r
+/* See the POSIX:2001 specification
+ <http://www.opengroup.org/susv3xsh/asctime.html>. */
char *asctime_r (struct tm const * restrict, char * restrict);
+
+/* See the POSIX:2001 specification
+ <http://www.opengroup.org/susv3xsh/ctime.html>. */
char *ctime_r (time_t const *, char *);
+
+/* See the POSIX:2001 specification
+ <http://www.opengroup.org/susv3xsh/gmtime.html>. */
struct tm *gmtime_r (time_t const * restrict, struct tm * restrict);
+
+/* See the POSIX:2001 specification
+ <http://www.opengroup.org/susv3xsh/localtime.html>. */
struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
#endif
diff --git a/lib/timespec.h b/lib/timespec.h
index 01032f336..8188c208c 100644
--- a/lib/timespec.h
+++ b/lib/timespec.h
@@ -19,8 +19,6 @@
#if ! defined TIMESPEC_H
# define TIMESPEC_H
-/* You must include config.h before including this file. */
-
# include <sys/types.h>
# if TIME_WITH_SYS_TIME
# include <sys/time.h>
diff --git a/lib/unicodeio.h b/lib/unicodeio.h
index 31b69fad9..9560f6e07 100644
--- a/lib/unicodeio.h
+++ b/lib/unicodeio.h
@@ -1,6 +1,6 @@
/* Unicode character output to streams with locale dependent encoding.
- Copyright (C) 2000-2003 Free Software Foundation, Inc.
+ Copyright (C) 2000-2003, 2005 Free 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
@@ -22,6 +22,19 @@
# include <stddef.h>
# include <stdio.h>
+/* Converts the Unicode character CODE to its multibyte representation
+ in the current locale and calls the SUCCESS callback on the resulting
+ byte sequence. If an error occurs, invokes the FAILURE callback instead,
+ passing it CODE and an English error string.
+ Returns whatever the callback returned.
+ Assumes that the locale doesn't change between two calls. */
+extern long unicode_to_mb (unsigned int code,
+ long (*success) (const char *buf, size_t buflen,
+ void *callback_arg),
+ long (*failure) (unsigned int code, const char *msg,
+ void *callback_arg),
+ void *callback_arg);
+
/* Outputs the Unicode character CODE to the output stream STREAM.
Upon failure, exit if exit_on_error is true, otherwise output a fallback
notation. */
diff --git a/lib/unistd--.h b/lib/unistd--.h
index 14b6e15cc..1fe6ce8b2 100644
--- a/lib/unistd--.h
+++ b/lib/unistd--.h
@@ -23,3 +23,6 @@
#undef dup
#define dup dup_safer
+
+#undef pipe
+#define pipe pipe_safer
diff --git a/lib/unlinkdir.c b/lib/unlinkdir.c
index 4d53fa02f..d3584bebf 100644
--- a/lib/unlinkdir.c
+++ b/lib/unlinkdir.c
@@ -18,7 +18,9 @@
/* Written by Paul Eggert and Jim Meyering. */
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include "unlinkdir.h"
diff --git a/lib/userspec.c b/lib/userspec.c
index d09a6b212..b09c8d8a1 100644
--- a/lib/userspec.c
+++ b/lib/userspec.c
@@ -18,7 +18,7 @@
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/utimecmp.c b/lib/utimecmp.c
index 4c8e6c9ca..7308929f4 100644
--- a/lib/utimecmp.c
+++ b/lib/utimecmp.c
@@ -18,7 +18,7 @@
/* Written by Paul Eggert. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/version-etc-fsf.c b/lib/version-etc-fsf.c
index a91ab8687..374100563 100644
--- a/lib/version-etc-fsf.c
+++ b/lib/version-etc-fsf.c
@@ -17,7 +17,7 @@
/* Written by Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/version-etc.c b/lib/version-etc.c
index f27f6a43a..05bc3ad25 100644
--- a/lib/version-etc.c
+++ b/lib/version-etc.c
@@ -17,7 +17,7 @@
/* Written by Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/xalloc-die.c b/lib/xalloc-die.c
index 637933e30..ff5ac9e67 100644
--- a/lib/xalloc-die.c
+++ b/lib/xalloc-die.c
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/xgetcwd.c b/lib/xgetcwd.c
index f8116f224..0f798dac0 100644
--- a/lib/xgetcwd.c
+++ b/lib/xgetcwd.c
@@ -18,7 +18,7 @@
/* Written by Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/xgethostname.c b/lib/xgethostname.c
index 2facf9b1d..656ef4101 100644
--- a/lib/xgethostname.c
+++ b/lib/xgethostname.c
@@ -28,7 +28,6 @@
#include <stdlib.h>
#include <errno.h>
-
#include <unistd.h>
#include "xalloc.h"
diff --git a/lib/xmalloc.c b/lib/xmalloc.c
index 6977703b8..687633c25 100644
--- a/lib/xmalloc.c
+++ b/lib/xmalloc.c
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/xmemcoll.c b/lib/xmemcoll.c
index 063612e95..f04e468d8 100644
--- a/lib/xmemcoll.c
+++ b/lib/xmemcoll.c
@@ -17,7 +17,7 @@
/* Contributed by Paul Eggert <eggert@twinsun.com>. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/xnanosleep.c b/lib/xnanosleep.c
index f2d9e93be..bab58eecb 100644
--- a/lib/xnanosleep.c
+++ b/lib/xnanosleep.c
@@ -18,7 +18,7 @@
/* Mostly written (for sleep.c) by Paul Eggert.
Factored out (creating this file) by Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/xreadlink.c b/lib/xreadlink.c
index 63f5ce1bf..b8bb3c4df 100644
--- a/lib/xreadlink.c
+++ b/lib/xreadlink.c
@@ -19,7 +19,7 @@
/* Written by Jim Meyering <jim@meyering.net> */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/xstrndup.c b/lib/xstrndup.c
index edf83cf87..a62d4bd69 100644
--- a/lib/xstrndup.c
+++ b/lib/xstrndup.c
@@ -16,7 +16,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/xstrtoimax.c b/lib/xstrtoimax.c
index b1bc36162..3e585d6e0 100644
--- a/lib/xstrtoimax.c
+++ b/lib/xstrtoimax.c
@@ -17,7 +17,7 @@
/* Cloned by Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/xstrtol.c b/lib/xstrtol.c
index 9940fc770..d01db3ca9 100644
--- a/lib/xstrtol.c
+++ b/lib/xstrtol.c
@@ -19,7 +19,7 @@
/* Written by Jim Meyering. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/xstrtoumax.c b/lib/xstrtoumax.c
index d7cf2bed8..e6208a474 100644
--- a/lib/xstrtoumax.c
+++ b/lib/xstrtoumax.c
@@ -17,7 +17,7 @@
/* Written by Paul Eggert. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
diff --git a/lib/yesno.c b/lib/yesno.c
index e4b945838..a364a1b18 100644
--- a/lib/yesno.c
+++ b/lib/yesno.c
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif