changeset 4517:17fd8075851d

Merge from coreutils.
author Paul Eggert <eggert@cs.ucla.edu>
date Sat, 09 Aug 2003 08:57:49 +0000
parents 9e5480f5e6e1
children d600e2a8fe03
files lib/ChangeLog lib/acl.c lib/alloca.c lib/alloca_.h lib/regex.h
diffstat 5 files changed, 37 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,14 @@
+2003-08-09  Paul Eggert  <eggert@twinsun.com>
+
+	Merge some files from coreutils.  These changes were
+	originally made by Jim Meyering.
+	* lib/acl.c: Include <sys/types.h> before <sys/stat.h>;
+	many older Unixes require this.
+	* lib/alloca.c (alloca): Remove cast to argument of free;
+	no longer needed in C89.
+	* lib/alloca_.h, lib/regex.h: Fix white space to match
+	what GNU indent does.
+
 2003-08-05  Paul Eggert  <eggert@twinsun.com>
 
 	* bumpalloc.h: Remove.
--- a/lib/acl.c
+++ b/lib/acl.c
@@ -1,6 +1,6 @@
 /* acl.c - access control lists
 
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003 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,7 @@
 # include <config.h>
 #endif
 
+#include <sys/types.h>
 #include <sys/stat.h>
 #ifndef S_ISLNK
 # define S_ISLNK(Mode) 0
--- a/lib/alloca.c
+++ b/lib/alloca.c
@@ -193,7 +193,7 @@
 	{
 	  register header *np = hp->h.next;
 
-	  free ((pointer) hp);	/* Collect garbage.  */
+	  free (hp);		/* Collect garbage.  */
 
 	  hp = np;		/* -> next header.  */
 	}
--- a/lib/alloca_.h
+++ b/lib/alloca_.h
@@ -21,7 +21,7 @@
    "config.h", not later.  */
 
 #ifndef _ALLOCA_H
-#define _ALLOCA_H
+# define _ALLOCA_H
 
 /* alloca(N) returns a pointer (void* or char*) to N bytes of memory
    allocated on the stack, and which will last until the function returns.
@@ -34,35 +34,35 @@
        request, the program just crashes.
  */
 
-#ifdef __GNUC__
-# ifndef alloca
-#  define alloca __builtin_alloca
-# endif
-#else
-# ifdef _MSC_VER
-#  include <malloc.h>
-#  define alloca _alloca
+# ifdef __GNUC__
+#  ifndef alloca
+#   define alloca __builtin_alloca
+#  endif
 # else
-#  if HAVE_ALLOCA_H
-#   include <alloca.h>
+#  ifdef _MSC_VER
+#   include <malloc.h>
+#   define alloca _alloca
 #  else
-#   ifdef _AIX
- #pragma alloca
+#   if HAVE_ALLOCA_H
+#    include <alloca.h>
 #   else
-#    ifdef __hpux /* This section must match that of bison generated files. */
-#     ifdef __cplusplus
+#    ifdef _AIX
+ #    pragma alloca
+#    else
+#     ifdef __hpux /* This section must match that of bison generated files. */
+#      ifdef __cplusplus
 extern "C" void *alloca (unsigned int);
-#     else /* not __cplusplus */
+#      else /* not __cplusplus */
 extern void *alloca ();
-#     endif /* not __cplusplus */
-#    else /* not __hpux */
-#     ifndef alloca
+#      endif /* not __cplusplus */
+#     else /* not __hpux */
+#      ifndef alloca
 extern char *alloca ();
-#     endif
-#    endif /* __hpux */
+#      endif
+#     endif /* __hpux */
+#    endif
 #   endif
 #  endif
 # endif
-#endif
 
 #endif /* _ALLOCA_H */
--- a/lib/regex.h
+++ b/lib/regex.h
@@ -193,7 +193,7 @@
    & ~(RE_DOT_NOT_NULL | RE_INTERVALS | RE_CONTEXT_INDEP_OPS		\
        | RE_CONTEXT_INVALID_OPS ))
 
-#define RE_SYNTAX_POSIX_AWK 						\
+#define RE_SYNTAX_POSIX_AWK						\
   (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS		\
    | RE_INTERVALS	    | RE_NO_GNU_OPS)