changeset 106:28cf48a906e4

GNU file utilities
author Jim Meyering <jim@meyering.net>
date Wed, 06 Oct 1993 16:41:02 +0000
parents 952d63bc09af
children 76e5ae69d7ab
files lib/Makefile.in lib/argmatch.c lib/backupfile.c lib/dirname.c lib/fileblocks.c lib/fsusage.c lib/ftruncate.c lib/getversion.c lib/idcache.c lib/isdir.c lib/makepath.c lib/mkdir.c lib/modechange.c lib/mountlist.c lib/rename.c lib/savedir.c lib/strdup.c lib/stripslash.c lib/userspec.c lib/xstrdup.c lib/yesno.c
diffstat 21 files changed, 232 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -49,7 +49,7 @@
 all: libfu.a
 
 .c.o:
-	$(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) $(CFLAGS) $<
+	$(CC) -c $(CPPFLAGS) $(DEFS) -I.. -I$(srcdir) $(CFLAGS) $<
 
 install: all
 
--- a/lib/argmatch.c
+++ b/lib/argmatch.c
@@ -17,6 +17,17 @@
 
 /* Written by David MacKenzie <djm@ai.mit.edu> */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <stdio.h>
 #ifdef STDC_HEADERS
 #include <string.h>
--- a/lib/backupfile.c
+++ b/lib/backupfile.c
@@ -18,6 +18,17 @@
 /* David MacKenzie <djm@gnu.ai.mit.edu>.
    Some algorithms adapted from GNU Emacs. */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/types.h>
--- a/lib/dirname.c
+++ b/lib/dirname.c
@@ -15,6 +15,17 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #ifdef STDC_HEADERS
 #include <stdlib.h>
 #else
--- a/lib/fileblocks.c
+++ b/lib/fileblocks.c
@@ -17,6 +17,17 @@
 
 /* Written by Brian L. Matthews, blm@6sceng.UUCP. */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #if !defined (HAVE_ST_BLOCKS) && !defined(_POSIX_SOURCE)
 #include <sys/types.h>
 #include <sys/param.h>
--- a/lib/fsusage.c
+++ b/lib/fsusage.c
@@ -15,6 +15,17 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <sys/types.h>
 #include "fsusage.h"
 
--- a/lib/ftruncate.c
+++ b/lib/ftruncate.c
@@ -1,6 +1,17 @@
 /* ftruncate emulations that work on some System V's.
    This file is in the public domain. */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <sys/types.h>
 #include <fcntl.h>
 
--- a/lib/getversion.c
+++ b/lib/getversion.c
@@ -17,6 +17,17 @@
 
 /* Written by David MacKenzie <djm@gnu.ai.mit.edu> */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include "backupfile.h"
 
 #ifdef STDC_HEADERS
--- a/lib/idcache.c
+++ b/lib/idcache.c
@@ -15,6 +15,17 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <pwd.h>
--- a/lib/isdir.c
+++ b/lib/isdir.c
@@ -15,6 +15,17 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <sys/types.h>
 #include <sys/stat.h>
 
--- a/lib/makepath.c
+++ b/lib/makepath.c
@@ -18,6 +18,17 @@
 /* Written by David MacKenzie <djm@gnu.ai.mit.edu> and
    Jim Meyering <meyering@cs.utexas.edu>.  */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #ifdef __GNUC__
 #define alloca __builtin_alloca
 #else
@@ -32,6 +43,17 @@
 #endif
 #endif
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
--- a/lib/mkdir.c
+++ b/lib/mkdir.c
@@ -15,6 +15,17 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
--- a/lib/modechange.c
+++ b/lib/modechange.c
@@ -24,6 +24,17 @@
    changing the mode of many files, this probably results in a
    performance gain. */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include "modechange.h"
--- a/lib/mountlist.c
+++ b/lib/mountlist.c
@@ -15,6 +15,17 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <stdio.h>
 #include <sys/types.h>
 #include "mountlist.h"
--- a/lib/rename.c
+++ b/lib/rename.c
@@ -15,6 +15,17 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
--- a/lib/savedir.c
+++ b/lib/savedir.c
@@ -17,6 +17,17 @@
 
 /* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <sys/types.h>
 
 #ifdef HAVE_UNISTD_H
--- a/lib/strdup.c
+++ b/lib/strdup.c
@@ -15,6 +15,17 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #ifdef STDC_HEADERS
 #include <string.h>
 #include <stdlib.h>
--- a/lib/stripslash.c
+++ b/lib/stripslash.c
@@ -15,6 +15,17 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
 #include <string.h>
 #else
--- a/lib/userspec.c
+++ b/lib/userspec.c
@@ -17,6 +17,17 @@
 
 /* Written by David MacKenzie <djm@gnu.ai.mit.edu>.  */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <pwd.h>
--- a/lib/xstrdup.c
+++ b/lib/xstrdup.c
@@ -15,6 +15,17 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
 #include <string.h>
 #else
--- a/lib/yesno.c
+++ b/lib/yesno.c
@@ -15,6 +15,17 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+#ifdef HAVE_CONFIG_H
+#if defined (CONFIG_BROKETS)
+/* We use <config.h> instead of "config.h" so that a compilation
+   using -I. -I will use ./config.h rather than /config.h
+   (which it would do because it found this file in ).  */
+#include <config.h>
+#else
+#include "config.h"
+#endif
+#endif
+
 #include <stdio.h>
 
 /* Read one line from standard input