Sync from coreutils.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 2 Jun 2005 20:41:04 +0000 (20:41 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 2 Jun 2005 20:41:04 +0000 (20:41 +0000)
Use "file name" when talking about file names, instead of "filename"
or "path", as per the GNU coding standards.

* MODULES.html.sh: mkdir-p renamed from makepath.
filenamecat renamed from path-concat.
* modules/filenamecat: Renamed from modules/path-concat.
(Files): filenamecat.h and filenamecat.c renamed from
path-concat.h and path-concat.c.
(configure.ac): gl_FILE_NAME_CONCAT, not gl_PATH_CONCAT.
(Include): filenamecat.h, not path-concat.h.
* modules/mkdir-p: Renamed from modules/makepath.
(Files): mkdir-p.h and mkdir-p.c renamed from makepath.h and makepath.c.
(configure.ac): gl_MKDIR_PARENTS, not gl_MAKEPATH.
(Include): mkdir-p.h, not makepath.h.
* lib/mkdir-p.c: Renamed from makepath.c.
(make_dir_parents): Renamed from make_path.  All callers changed.
* lib/mkdir-p.h: Likewise.  All includers changed.
* lib/filenamecat.c: Renamed from path-concat.c.
(file_name_concat): Renamed from path_concat.  All callers changed.
[TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
* lib/filenamecat.h: Likewise.  All includers changed.
* lib/acl.c: Don't use "path" or "filename" to mean "file name"
in comments or local variable names.
* lib/basename.c: Likewise.
* lib/canonicalize.c, canonicalize.h: Likewise.
* lib/dirname.c, dirname.h: Likewise.
* lib/euidaccess.c: Likewise.
* lib/exclude.c: Likewise
* lib/fnmatch_.h, fnmatch_loop.c: Likewise.
* lib/fsusage.c, fsuage.h: Likewise.
* lib/fts.c, fts_.h: Likewise.
* lib/getcwd.c: Likewise.
* lib/getloadavg.c: Likewise.
* lib/mkstemp.c: Likewise.
* lib/mountlist.c, mountlist.h: Likewise.
* lib/openat.c, openat.h: Likewise.
* lib/readlink-stub.c: Likewise.
* lib/readutmp.c, readutmp.h: Likewise.
* lib/rename.c: Likewise.
* lib/rmdir.c: Likewise.
* lib/same.c: Likewise.
* lib/savedir.c: Likewise.
* lib/stripslash.c: Likewise.
* lib/tempname.c: Likewise.
* lib/xreadlink.c: Likewise.
* lib/exclude.c (excluded_file_name): Renamed from excluded_filename.
All uses changed.
* lib/exclude.h: Likewise.
* m4/mkdir-p.m4: Renamed from makepath.m4.
(gl_MKDIR_PARENTS): Renamed from gl_MAKEPATH.  All uses changed.
Rename files from makepath.c to mkdir-p.c, and from
makepath.h to mkdir-p.h.
* m4/filenamecat.m4: Renamed from path-concat.m4.
(gl_FILE_NAME_CONCAT): Renamed from gl_PATH_CONCAT.  All uses changed.
Rename files from path-concat.c to filenamecat.c,
and from path-concat.h to filenamecat.h.
* m4/getcwd-path-max.m4: Don't use "path" or "filename" to mean
"file name" in local variables or comments.
* rename.m4: Likewise.

* lib/euidaccess.c (getuid, getgid, getuid, getegid)
[!defined _POSIX_VERSION]: Remove decls; not needed these days.
* lib/idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
[!defined _POSIX_VERSION]: Remove decls; not needed these days.
* lib/pathmax.h: Include <limits.h> unconditionally, since other
files have been getting away with it for years (MORE/BSD 4.3
is extinct now).
* lib/userspec.c (getpwnam, getgrnam, getgrgid)
[!defined _POSIX_VERSION]: Remove decls; not needed these days.

* lib/pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
Define to 256, not 255, as per modern POSIX.

58 files changed:
ChangeLog
MODULES.html.sh
lib/ChangeLog
lib/acl.c
lib/basename.c
lib/canonicalize.c
lib/canonicalize.h
lib/dirname.c
lib/dirname.h
lib/euidaccess.c
lib/exclude.c
lib/exclude.h
lib/filenamecat.c [new file with mode: 0644]
lib/filenamecat.h [new file with mode: 0644]
lib/fnmatch_.h
lib/fnmatch_loop.c
lib/fsusage.c
lib/fsusage.h
lib/fts-cycle.c
lib/fts.c
lib/fts_.h
lib/getcwd.c
lib/getloadavg.c
lib/idcache.c
lib/makepath.c [deleted file]
lib/makepath.h [deleted file]
lib/mkdir-p.c [new file with mode: 0644]
lib/mkdir-p.h [new file with mode: 0644]
lib/mkstemp.c
lib/mountlist.c
lib/mountlist.h
lib/openat.c
lib/openat.h
lib/path-concat.c [deleted file]
lib/path-concat.h [deleted file]
lib/pathmax.h
lib/readutmp.c
lib/readutmp.h
lib/rename.c
lib/rmdir.c
lib/same.c
lib/savedir.c
lib/stripslash.c
lib/tempname.c
lib/userspec.c
lib/xreadlink.c
m4/ChangeLog
m4/filenamecat.m4 [new file with mode: 0644]
m4/getcwd-path-max.m4
m4/makepath.m4 [deleted file]
m4/mkdir-p.m4 [new file with mode: 0644]
m4/path-concat.m4 [deleted file]
m4/rename.m4
modules/canonicalize
modules/filenamecat [new file with mode: 0644]
modules/makepath [deleted file]
modules/mkdir-p [new file with mode: 0644]
modules/path-concat [deleted file]

index 37ff9492f776fdb8675d10f554b7508fc6638335..f3319ad62b21aa53cd73f45a03fe3f6f00a2583d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Sync from coreutils.
+       Use "file name" when talking about file names, instead of "filename"
+       or "path", as per the GNU coding standards.
+       * MODULES.html.sh: mkdir-p renamed from makepath.
+       filenamecat renamed from path-concat.
+       * modules/filenamecat: Renamed from modules/path-concat.
+       (Files): filenamecat.h and filenamecat.c renamed from
+       path-concat.h and path-concat.c.
+       (configure.ac): gl_FILE_NAME_CONCAT, not gl_PATH_CONCAT.
+       (Include): filenamecat.h, not path-concat.h.
+       * modules/mkdir-p: Renamed from modules/makepath.
+       (Files): mkdir-p.h and mkdir-p.c renamed from makepath.h and makepath.c.
+       (configure.ac): gl_MKDIR_PARENTS, not gl_MAKEPATH.
+       (Include): mkdir-p.h, not makepath.h.
+
 2005-06-01  Bruno Haible  <bruno@clisp.org>
 
        * modules/csharpexec: New file.
index cd7e5e224f47183b5d9fd3232ebe7b53fbd69eb9..03620bc35e68c1479512807676a6ea391139870d 100755 (executable)
@@ -1817,14 +1817,14 @@ func_all_modules ()
   func_module file-type
   func_module fileblocks
   func_module filemode
+  func_module filenamecat
   func_module fts
   func_module fts-lgpl
   func_module isdir
   func_module lchown
-  func_module makepath
+  func_module mkdir-p
   func_module modechange
   func_module mountlist
-  func_module path-concat
   func_module pathname
   func_module pathmax
   func_module same
index 31e0a920409eabb84bacfd87c95ace29567702e5..f8269a58611ee0b5dfe2255f40a135e5053f50a6 100644 (file)
@@ -1,3 +1,56 @@
+2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Sync from coreutils.
+       Use "file name" when talking about file names, instead of "filename"
+       or "path", as per the GNU coding standards.
+       * mkdir-p.c: Renamed from makepath.c.
+       (make_dir_parents): Renamed from make_path.  All callers changed.
+       * mkdir-p.h: Likewise.  All includers changed.
+       * filenamecat.c: Renamed from path-concat.c.
+       (file_name_concat): Renamed from path_concat.  All callers changed.
+       [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
+       * filenamecat.h: Likewise.  All includers changed.
+       * acl.c: Don't use "path" or "filename" to mean "file name"
+       in comments or local variable names.
+       * basename.c: Likewise.
+       * canonicalize.c, canonicalize.h: Likewise.
+       * dirname.c, dirname.h: Likewise.
+       * euidaccess.c: Likewise.
+       * exclude.c: Likewise
+       * fnmatch_.h, fnmatch_loop.c: Likewise.
+       * fsusage.c, fsuage.h: Likewise.
+       * fts.c, fts_.h: Likewise.
+       * getcwd.c: Likewise.
+       * getloadavg.c: Likewise.
+       * mkstemp.c: Likewise.
+       * mountlist.c, mountlist.h: Likewise.
+       * openat.c, openat.h: Likewise.
+       * readlink-stub.c: Likewise.
+       * readutmp.c, readutmp.h: Likewise.
+       * rename.c: Likewise.
+       * rmdir.c: Likewise.
+       * same.c: Likewise.
+       * savedir.c: Likewise.
+       * stripslash.c: Likewise.
+       * tempname.c: Likewise.
+       * xreadlink.c: Likewise.
+       * exclude.c (excluded_file_name): Renamed from excluded_filename.
+       All uses changed.
+       * exclude.h: Likewise.
+
+       * euidaccess.c (getuid, getgid, getuid, getegid)
+       [!defined _POSIX_VERSION]: Remove decls; not needed these days.
+       * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
+       [!defined _POSIX_VERSION]: Remove decls; not needed these days.
+       * pathmax.h: Include <limits.h> unconditionally, since other
+       files have been getting away with it for years (MORE/BSD 4.3
+       is extinct now).
+       * userspec.c (getpwnam, getgrnam, getgrgid)
+       [!defined _POSIX_VERSION]: Remove decls; not needed these days.
+
+       * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
+       Define to 256, not 255, as per modern POSIX.
+
 2005-06-01  Bruno Haible  <bruno@clisp.org>
 
        * csharpexec.h: New file, from GNU gettext.
index 4e759cddef5621acd6b563a041590a1d914d4e0b..47b73bd2353b2ed612d743a946e1b12e5a289a9d 100644 (file)
--- a/lib/acl.c
+++ b/lib/acl.c
@@ -1,6 +1,6 @@
 /* acl.c - access control lists
 
-   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
 # define MIN_ACL_ENTRIES 4
 #endif
 
-/* Return 1 if PATH has a nontrivial access control list, 0 if not,
+/* Return 1 if FILE has a nontrivial access control list, 0 if not,
    and -1 (setting errno) if an error is encountered.  */
 
 int
-file_has_acl (char const *path, struct stat const *pathstat)
+file_has_acl (char const *file, struct stat const *filestat)
 {
   /* FIXME: This implementation should work on recent-enough versions
      of HP-UX, Solaris, and Unixware, but it simply returns 0 with
@@ -52,9 +52,9 @@ file_has_acl (char const *path, struct stat const *pathstat)
      fix-related ideas.  */
 
 #if HAVE_ACL && defined GETACLCNT
-  if (! S_ISLNK (pathstat->st_mode))
+  if (! S_ISLNK (filestat->st_mode))
     {
-      int n = acl (path, GETACLCNT, 0, NULL);
+      int n = acl (file, GETACLCNT, 0, NULL);
       return n < 0 ? (errno == ENOSYS ? 0 : -1) : (MIN_ACL_ENTRIES < n);
     }
 #endif
index b6de3d610ec7b73a7f9199fe5fd2680c91dae5f7..00adc0015e9df072fe170f43bf942cebde662773 100644 (file)
@@ -1,6 +1,6 @@
-/* basename.c -- return the last element in a path
+/* basename.c -- return the last element in a file name
 
-   Copyright (C) 1990, 1998, 1999, 2000, 2001, 2003, 2004 Free
+   Copyright (C) 1990, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free
    Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
index 822fe6f75ae6640d81b40eda02ba3791d031d6b6..571fa19e231dda063a9729d03aaf4652bb0043c7 100644 (file)
@@ -48,7 +48,7 @@ void free ();
 #include <stddef.h>
 
 #include "cycle-check.h"
-#include "path-concat.h"
+#include "filenamecat.h"
 #include "stat-macros.h"
 #include "xalloc.h"
 #include "xgetcwd.h"
@@ -62,8 +62,8 @@ void free ();
 
 #if !HAVE_CANONICALIZE_FILE_NAME
 /* Return the canonical absolute name of file NAME.  A canonical name
-   does not contain any `.', `..' components nor any repeated path
-   separators ('/') or symlinks.  All path components must exist.
+   does not contain any `.', `..' components nor any repeated file name
+   separators ('/') or symlinks.  All components must exist.
    The result is malloc'd.  */
 
 char *
@@ -89,7 +89,7 @@ canonicalize_file_name (const char *name)
 
   /* All known hosts with resolvepath (e.g. Solaris 7) don't turn
      relative names into absolute ones, so prepend the working
-     directory if the path is not absolute.  */
+     directory if the file name is not absolute.  */
   if (name[0] != '/')
     {
       char *wd;
@@ -97,7 +97,7 @@ canonicalize_file_name (const char *name)
       if (!(wd = xgetcwd ()))
        return NULL;
 
-      extra_buf = path_concat (wd, name, NULL);
+      extra_buf = file_name_concat (wd, name, NULL);
       name = extra_buf;
       free (wd);
     }
@@ -135,15 +135,17 @@ canonicalize_file_name (const char *name)
 #endif /* !HAVE_CANONICALIZE_FILE_NAME */
 
 /* Return the canonical absolute name of file NAME.  A canonical name
-   does not contain any `.', `..' components nor any repeated path
-   separators ('/') or symlinks.  Whether path components must exist
+   does not contain any `.', `..' components nor any repeated file name
+   separators ('/') or symlinks.  Whether components must exist
    or not depends on canonicalize mode.  The result is malloc'd.  */
 
 char *
 canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
 {
-  char *rpath, *dest, *extra_buf = NULL;
-  const char *start, *end, *rpath_limit;
+  char *rname, *dest, *extra_buf = NULL;
+  char const *start;
+  char const *end;
+  char const *rname_limit;
   size_t extra_len = 0;
   struct cycle_check_state cycle_state;
 
@@ -161,38 +163,38 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
 
   if (name[0] != '/')
     {
-      rpath = xgetcwd ();
-      if (!rpath)
+      rname = xgetcwd ();
+      if (!rname)
        return NULL;
-      dest = strchr (rpath, '\0');
-      if (dest - rpath < PATH_MAX)
+      dest = strchr (rname, '\0');
+      if (dest - rname < PATH_MAX)
        {
-         char *p = xrealloc (rpath, PATH_MAX);
-         dest = p + (dest - rpath);
-         rpath = p;
-         rpath_limit = rpath + PATH_MAX;
+         char *p = xrealloc (rname, PATH_MAX);
+         dest = p + (dest - rname);
+         rname = p;
+         rname_limit = rname + PATH_MAX;
        }
       else
        {
-         rpath_limit = dest;
+         rname_limit = dest;
        }
     }
   else
     {
-      rpath = xmalloc (PATH_MAX);
-      rpath_limit = rpath + PATH_MAX;
-      rpath[0] = '/';
-      dest = rpath + 1;
+      rname = xmalloc (PATH_MAX);
+      rname_limit = rname + PATH_MAX;
+      rname[0] = '/';
+      dest = rname + 1;
     }
 
   cycle_check_init (&cycle_state);
   for (start = end = name; *start; start = end)
     {
-      /* Skip sequence of multiple path-separators.  */
+      /* Skip sequence of multiple file name separators.  */
       while (*start == '/')
        ++start;
 
-      /* Find end of path component.  */
+      /* Find end of component.  */
       for (end = start; *end && *end != '/'; ++end)
        /* Nothing.  */;
 
@@ -203,7 +205,7 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
       else if (end - start == 2 && start[0] == '.' && start[1] == '.')
        {
          /* Back up to previous component, ignore if at root already.  */
-         if (dest > rpath + 1)
+         if (dest > rname + 1)
            while ((--dest)[-1] != '/');
        }
       else
@@ -213,26 +215,26 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
          if (dest[-1] != '/')
            *dest++ = '/';
 
-         if (dest + (end - start) >= rpath_limit)
+         if (dest + (end - start) >= rname_limit)
            {
-             ptrdiff_t dest_offset = dest - rpath;
-             size_t new_size = rpath_limit - rpath;
+             ptrdiff_t dest_offset = dest - rname;
+             size_t new_size = rname_limit - rname;
 
              if (end - start + 1 > PATH_MAX)
                new_size += end - start + 1;
              else
                new_size += PATH_MAX;
-             rpath = xrealloc (rpath, new_size);
-             rpath_limit = rpath + new_size;
+             rname = xrealloc (rname, new_size);
+             rname_limit = rname + new_size;
 
-             dest = rpath + dest_offset;
+             dest = rname + dest_offset;
            }
 
          dest = memcpy (dest, start, end - start);
          dest += end - start;
          *dest = '\0';
 
-         if (lstat (rpath, &st) < 0)
+         if (lstat (rname, &st) != 0)
            {
              if (can_mode == CAN_EXISTING)
                goto error;
@@ -255,7 +257,7 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
                    goto error;
                }
 
-             buf = xreadlink (rpath, st.st_size);
+             buf = xreadlink (rname, st.st_size);
              if (!buf)
                {
                  if (can_mode == CAN_MISSING)
@@ -284,10 +286,10 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
              name = end = memcpy (extra_buf, buf, n);
 
              if (buf[0] == '/')
-               dest = rpath + 1;       /* It's an absolute symlink */
+               dest = rname + 1;       /* It's an absolute symlink */
              else
                /* Back up to previous component, ignore if at root already: */
-               if (dest > rpath + 1)
+               if (dest > rname + 1)
                  while ((--dest)[-1] != '/');
 
              free (buf);
@@ -302,15 +304,15 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
            }
        }
     }
-  if (dest > rpath + 1 && dest[-1] == '/')
+  if (dest > rname + 1 && dest[-1] == '/')
     --dest;
   *dest = '\0';
 
   free (extra_buf);
-  return rpath;
+  return rname;
 
 error:
   free (extra_buf);
-  free (rpath);
+  free (rname);
   return NULL;
 }
index 4c9596f98ff34bff5849d04145f4bdb3168419b3..4cae3c55123d864b28b54ebb2b680689a8618bfc 100644 (file)
@@ -1,5 +1,5 @@
 /* Return the canonical absolute name of a given file.
-   Copyright (C) 1996-2004 Free Software Foundation, Inc.
+   Copyright (C) 1996-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
 
 enum canonicalize_mode_t
   {
-    /* All path components must exist.  */
+    /* All components must exist.  */
     CAN_EXISTING = 0,
 
-    /* All path components excluding last one must exist.  */
+    /* All components excluding last one must exist.  */
     CAN_ALL_BUT_LAST = 1,
 
     /* No requirements on components existence.  */
index 9b60076569ba0a29327e5cb0f1f6f5a6f6fe288f..f1930c8d2f0eaa307c37933185766e580a87cd9e 100644 (file)
@@ -1,6 +1,6 @@
-/* dirname.c -- return all but the last element in a path
+/* dirname.c -- return all but the last element in a file name
 
-   Copyright (C) 1990, 1998, 2000, 2001, 2003, 2004 Free Software
+   Copyright (C) 1990, 1998, 2000, 2001, 2003, 2004, 2005 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
 #include <string.h>
 #include "xalloc.h"
 
-/* Return the length of `dirname (PATH)', or zero if PATH is
+/* Return the length of `dirname (FILE)', or zero if FILE is
    in the working directory.  Works properly even if
    there are trailing slashes (by effectively ignoring them).  */
 size_t
-dir_len (char const *path)
+dir_len (char const *file)
 {
-  size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (path);
+  size_t prefix_length = FILE_SYSTEM_PREFIX_LEN (file);
   size_t length;
 
   /* Strip the basename and any redundant slashes before it.  */
-  for (length = base_name (path) - path;  prefix_length < length;  length--)
-    if (! ISSLASH (path[length - 1]))
+  for (length = base_name (file) - file;  prefix_length < length;  length--)
+    if (! ISSLASH (file[length - 1]))
       return length;
 
   /* But don't strip the only slash from "/".  */
-  return prefix_length + ISSLASH (path[prefix_length]);
+  return prefix_length + ISSLASH (file[prefix_length]);
 }
 
-/* Return the leading directories part of PATH,
+/* Return the leading directories part of FILE,
    allocated with xmalloc.
    Works properly even if there are trailing slashes
    (by effectively ignoring them).  */
 
 char *
-dir_name (char const *path)
+dir_name (char const *file)
 {
-  size_t length = dir_len (path);
-  bool append_dot = (length == FILE_SYSTEM_PREFIX_LEN (path));
-  char *newpath = xmalloc (length + append_dot + 1);
-  memcpy (newpath, path, length);
+  size_t length = dir_len (file);
+  bool append_dot = (length == FILE_SYSTEM_PREFIX_LEN (file));
+  char *dir = xmalloc (length + append_dot + 1);
+  memcpy (dir, file, length);
   if (append_dot)
-    newpath[length++] = '.';
-  newpath[length] = 0;
-  return newpath;
+    dir[length++] = '.';
+  dir[length] = 0;
+  return dir;
 }
 
 #ifdef TEST_DIRNAME
@@ -108,13 +108,13 @@ main (int argc, char *argv[])
   buff[MAX_BUFF_LEN] = 0;
   while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0])
     {
-      char path[MAX_BUFF_LEN];
+      char file[MAX_BUFF_LEN];
       char expected_result[MAX_BUFF_LEN];
       char const *result;
-      sscanf (buff, "%s %s", path, expected_result);
-      result = dir_name (path);
+      sscanf (buff, "%s %s", file, expected_result);
+      result = dir_name (file);
       if (strcmp (result, expected_result))
-       printf ("%s: got %s, expected %s\n", path, result, expected_result);
+       printf ("%s: got %s, expected %s\n", file, result, expected_result);
     }
   return 0;
 }
index 5c3c930502b7c2d78bf5f1d5d96611eb8c0433eb..1688ae810436133d1dfc6f5e14523233e0c309dd 100644 (file)
@@ -1,6 +1,6 @@
 /*  Take file names apart into directory and base names.
 
-    Copyright (C) 1998, 2001, 2003, 2004 Free Software Foundation, Inc.
+    Copyright (C) 1998, 2001, 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
 # endif
 
 # ifndef FILE_SYSTEM_PREFIX_LEN
-#  define FILE_SYSTEM_PREFIX_LEN(Filename) 0
+#  define FILE_SYSTEM_PREFIX_LEN(File_name) 0
 # endif
 
 # define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
 # define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
 
-char *base_name (char const *path);
-char *dir_name (char const *path);
-size_t base_len (char const *path);
-size_t dir_len (char const *path);
+char *base_name (char const *file);
+char *dir_name (char const *file);
+size_t base_len (char const *file);
+size_t dir_len (char const *file);
 
-bool strip_trailing_slashes (char *path);
+bool strip_trailing_slashes (char *file);
 
 #endif /* not DIRNAME_H_ */
index 7f8c238e27ed9ce1aa3e1cbb99eae48b96bf59ff..4bb93aa0b069314d43fb639f449c8063f5d736ca 100644 (file)
@@ -1,6 +1,6 @@
 /* euidaccess -- check if effective user id can access file
 
-   Copyright (C) 1990, 1991, 1995, 1998, 2000, 2003, 2004 Free
+   Copyright (C) 1990, 1991, 1995, 1998, 2000, 2003, 2004, 2005 Free
    Software Foundation, Inc.
 
    This file is part of the GNU C Library.
 # include <libgen.h>
 #endif
 
-#ifndef _POSIX_VERSION
-uid_t getuid ();
-gid_t getgid ();
-uid_t geteuid ();
-gid_t getegid ();
-#endif
-
 #include <errno.h>
 #ifndef __set_errno
 # define __set_errno(val) errno = (val)
@@ -84,21 +77,21 @@ gid_t getegid ();
 
 #endif
 
-/* Return 0 if the user has permission of type MODE on file PATH;
+/* Return 0 if the user has permission of type MODE on FILE;
    otherwise, return -1 and set `errno'.
    Like access, except that it uses the effective user and group
    id's instead of the real ones, and it does not always check for read-only
    file system, text busy, etc.  */
 
 int
-euidaccess (const char *path, int mode)
+euidaccess (const char *file, int mode)
 {
 #if defined EFF_ONLY_OK
-  return access (path, mode | EFF_ONLY_OK);
+  return access (file, mode | EFF_ONLY_OK);
 #elif defined ACC_SELF
-  return accessx (path, mode, ACC_SELF);
+  return accessx (file, mode, ACC_SELF);
 #elif HAVE_EACCESS
-  return eaccess (path, mode);
+  return eaccess (file, mode);
 #else
 
   uid_t uid = getuid ();
@@ -117,7 +110,7 @@ euidaccess (const char *path, int mode)
      safe.  */
 
   if (mode == F_OK)
-    return stat (path, &stats);
+    return stat (file, &stats);
   else
     {
       int result;
@@ -128,7 +121,7 @@ euidaccess (const char *path, int mode)
       if (gid != egid)
        setregid (egid, gid);
 
-      result = access (path, mode);
+      result = access (file, mode);
       saved_errno = errno;
 
       /* Restore them.  */
@@ -150,9 +143,9 @@ euidaccess (const char *path, int mode)
   unsigned int granted;
   if (uid == euid && gid == egid)
     /* If we are not set-uid or set-gid, access does the same.  */
-    return access (path, mode);
+    return access (file, mode);
 
-  if (stat (path, &stats))
+  if (stat (file, &stats) != 0)
     return -1;
 
   /* The super-user can read and write any file, and execute any file
index 39101c783db7da7aa8235ca2d11be660a79a66db..955c289563d03658c198b4d2116a3d0fe8fd89fc 100644 (file)
@@ -1,7 +1,7 @@
 /* exclude.c -- exclude file names
 
    Copyright (C) 1992, 1993, 1994, 1997, 1999, 2000, 2001, 2002, 2003,
-   2004 Free Software Foundation, Inc.
+   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
@@ -134,7 +134,7 @@ fnmatch_no_wildcards (char const *pattern, char const *f, int options)
 /* Return true if EX excludes F.  */
 
 bool
-excluded_filename (struct exclude const *ex, char const *f)
+excluded_file_name (struct exclude const *ex, char const *f)
 {
   size_t exclude_count = ex->exclude_count;
 
@@ -193,17 +193,17 @@ add_exclude (struct exclude *ex, char const *pattern, int options)
   patopts->options = options;
 }
 
-/* Use ADD_FUNC to append to EX the patterns in FILENAME, each with
+/* Use ADD_FUNC to append to EX the patterns in FILE_NAME, each with
    OPTIONS.  LINE_END terminates each pattern in the file.  If
    LINE_END is a space character, ignore trailing spaces and empty
    lines in FILE.  Return -1 on failure, 0 on success.  */
 
 int
 add_exclude_file (void (*add_func) (struct exclude *, char const *, int),
-                 struct exclude *ex, char const *filename, int options,
+                 struct exclude *ex, char const *file_name, int options,
                  char line_end)
 {
-  bool use_stdin = filename[0] == '-' && !filename[1];
+  bool use_stdin = file_name[0] == '-' && !file_name[1];
   FILE *in;
   char *buf = NULL;
   char *p;
@@ -216,7 +216,7 @@ add_exclude_file (void (*add_func) (struct exclude *, char const *, int),
 
   if (use_stdin)
     in = stdin;
-  else if (! (in = fopen (filename, "r")))
+  else if (! (in = fopen (file_name, "r")))
     return -1;
 
   while ((c = getc (in)) != EOF)
index 784d4389c8532c93dbd36a80563cea1305c4c4eb..6923efa5fb979a857c26db19f57e488b1e4fbc94 100644 (file)
@@ -1,7 +1,7 @@
 /* exclude.h -- declarations for excluding file names
 
-   Copyright (C) 1992, 1993, 1994, 1997, 1999, 2001, 2002, 2003 Free
-   Software Foundation, Inc.
+   Copyright (C) 1992, 1993, 1994, 1997, 1999, 2001, 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
@@ -40,4 +40,4 @@ void free_exclude (struct exclude *);
 void add_exclude (struct exclude *, char const *, int);
 int add_exclude_file (void (*) (struct exclude *, char const *, int),
                      struct exclude *, char const *, int, char);
-bool excluded_filename (struct exclude const *, char const *);
+bool excluded_file_name (struct exclude const *, char const *);
diff --git a/lib/filenamecat.c b/lib/filenamecat.c
new file mode 100644 (file)
index 0000000..f56697a
--- /dev/null
@@ -0,0 +1,126 @@
+/* Concatenate two arbitrary file names.
+
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 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
+   the Free Software Foundation; either version 2, 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
+   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.  */
+
+/* Written by Jim Meyering.  */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* Specification.  */
+#include "filenamecat.h"
+
+#include <string.h>
+
+#include "dirname.h"
+#include "xalloc.h"
+
+#if ! HAVE_MEMPCPY && ! defined mempcpy
+# define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
+#endif
+
+/* Return the longest suffix of F that is a relative file name.
+   If it has no such suffix, return the empty string.  */
+
+static char const *
+longest_relative_suffix (char const *f)
+{
+  for (f += FILE_SYSTEM_PREFIX_LEN (f); ISSLASH (*f); f++)
+    continue;
+  return f;
+}
+
+/* Concatenate two file name components, DIR and ABASE, in
+   newly-allocated storage and return the result.
+   The resulting file name F is such that the commands "ls F" and "(cd
+   DIR; ls BASE)" refer to the same file, where BASE is ABASE with any
+   file system prefixes and leading separators removed.
+   Arrange for a directory separator if necessary between DIR and BASE
+   in the result, removing any redundant separators.
+   In any case, if BASE_IN_RESULT is non-NULL, set
+   *BASE_IN_RESULT to point to the copy of ABASE in the returned
+   concatenation.  However, if ABASE begins with more than one slash,
+   set *BASE_IN_RESULT to point to the sole corresponding slash that
+   is copied into the result buffer.
+
+   Report an error if memory is exhausted.  */
+
+char *
+file_name_concat (char const *dir, char const *abase, char **base_in_result)
+{
+  char const *dirbase = base_name (dir);
+  size_t dirbaselen = base_len (dirbase);
+  size_t dirlen = dirbase - dir + dirbaselen;
+  size_t needs_separator = (dirbaselen && ! ISSLASH (dirbase[dirbaselen - 1]));
+
+  char const *base = longest_relative_suffix (abase);
+  size_t baselen = strlen (base);
+
+  char *p_concat = xmalloc (dirlen + needs_separator + baselen + 1);
+  char *p;
+
+  p = mempcpy (p_concat, dir, dirlen);
+  *p = DIRECTORY_SEPARATOR;
+  p += needs_separator;
+
+  if (base_in_result)
+    *base_in_result = p - IS_ABSOLUTE_FILE_NAME (abase);
+
+  p = mempcpy (p, base, baselen);
+  *p = '\0';
+
+  return p_concat;
+}
+
+#ifdef TEST_FILE_NAME_CONCAT
+# include <stdlib.h>
+# include <stdio.h>
+int
+main ()
+{
+  static char const *const tests[][3] =
+    {
+      {"a", "b",   "a/b"},
+      {"a/", "b",  "a/b"},
+      {"a/", "/b", "a/b"},
+      {"a", "/b",  "a/b"},
+
+      {"/", "b",  "/b"},
+      {"/", "/b", "/b"},
+      {"/", "/",  "/"},
+      {"a", "/",  "a/"},   /* this might deserve a diagnostic */
+      {"/a", "/", "/a/"},  /* this might deserve a diagnostic */
+      {"a", "//b",  "a/b"},
+    };
+  size_t i;
+  bool fail = false;
+  for (i = 0; i < sizeof tests / sizeof tests[0]; i++)
+    {
+      char *base_in_result;
+      char const *const *t = tests[i];
+      char *res = file_name_concat (t[0], t[1], &base_in_result);
+      if (strcmp (res, t[2]) != 0)
+       {
+         printf ("got %s, expected %s\n", res, t[2]);
+         fail = true;
+       }
+    }
+  exit (fail ? EXIT_FAILURE : EXIT_SUCCESS);
+}
+#endif
diff --git a/lib/filenamecat.h b/lib/filenamecat.h
new file mode 100644 (file)
index 0000000..c943b67
--- /dev/null
@@ -0,0 +1,22 @@
+/* Concatenate two arbitrary file names.
+
+   Copyright (C) 1996, 1997, 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
+   the Free Software Foundation; either version 2, 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
+   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.  */
+
+/* Written by Jim Meyering.  */
+
+char *file_name_concat (char const *dir, char const *base,
+                       char **base_in_result);
index a88d323a3fddb5a1483b0604796c12f065246e71..fecada57fbde5945a2d666676ef515240488c059 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999, 2001, 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
@@ -51,7 +51,7 @@ extern "C" {
 #  define FNM_NOSYS    (-1)
 # endif
 
-/* Match NAME against the filename pattern PATTERN,
+/* Match NAME against the file name pattern PATTERN,
    returning zero if it matches, FNM_NOMATCH if not.  */
 extern int fnmatch (const char *__pattern, const char *__name,
                    int __flags);
index feb73c1b1851b840643364c421e97ec272cd371f..35d59806194d370a8a99e14492c48c099ee13e77 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004
+/* Copyright (C) 1991,1992,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005
        Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -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.  */
 
-/* Match STRING against the filename pattern PATTERN, returning zero if
+/* Match STRING against the file name pattern PATTERN, returning zero if
    it matches, nonzero if not.  */
 static int EXT (INT opt, const CHAR *pattern, const CHAR *string,
                const CHAR *string_end, bool no_leading_period, int flags)
index d2a6cc21fbc1ab7b72d5cfdfa126bbcc5c15eb48..972d88f122c0ccd9bed7a862ee9a91a4969e72bd 100644 (file)
@@ -1,7 +1,7 @@
 /* fsusage.c -- return space usage of mounted file systems
 
-   Copyright (C) 1991, 1992, 1996, 1998, 1999, 2002, 2003, 2004 Free
-   Software Foundation, Inc.
+   Copyright (C) 1991, 1992, 1996, 1998, 1999, 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
 #define PROPAGATE_TOP_BIT(x) ((x) | ~ (EXTRACT_TOP_BIT (x) - 1))
 
 /* Fill in the fields of FSP with information about space usage for
-   the file system on which PATH resides.
-   DISK is the device on which PATH is mounted, for space-getting
+   the file system on which FILE resides.
+   DISK is the device on which FILE is mounted, for space-getting
    methods that need to know it.
    Return 0 if successful, -1 if not.  When returning -1, ensure that
    ERRNO is either a system error value, or zero if DISK is NULL
    on a system that requires a non-NULL value.  */
 int
-get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp)
+get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp)
 {
 #ifdef STAT_STATFS3_OSF1
 
   struct statfs fsd;
 
-  if (statfs (path, &fsd, sizeof (struct statfs)) != 0)
+  if (statfs (file, &fsd, sizeof (struct statfs)) != 0)
     return -1;
 
   fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize);
@@ -127,7 +127,7 @@ get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp)
 
   struct fs_data fsd;
 
-  if (statfs (path, &fsd) != 1)
+  if (statfs (file, &fsd) != 1)
     return -1;
 
   fsp->fsu_blocksize = 1024;
@@ -181,7 +181,7 @@ get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp)
 
   struct statfs fsd;
 
-  if (statfs (path, &fsd) < 0)
+  if (statfs (file, &fsd) < 0)
     return -1;
 
   fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_bsize);
@@ -207,7 +207,7 @@ get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp)
 
   struct statfs fsd;
 
-  if (statfs (path, &fsd) < 0)
+  if (statfs (file, &fsd) < 0)
     return -1;
 
   fsp->fsu_blocksize = PROPAGATE_ALL_ONES (fsd.f_fsize);
@@ -222,7 +222,7 @@ get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp)
 
   struct statfs fsd;
 
-  if (statfs (path, &fsd, sizeof fsd, 0) < 0)
+  if (statfs (file, &fsd, sizeof fsd, 0) < 0)
     return -1;
 
   /* Empirically, the block counts on most SVR3 and SVR3-derived
@@ -240,7 +240,7 @@ get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp)
 
   struct statvfs fsd;
 
-  if (statvfs (path, &fsd) < 0)
+  if (statvfs (file, &fsd) < 0)
     return -1;
 
   /* f_frsize isn't guaranteed to be supported.  */
@@ -269,12 +269,12 @@ get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp)
 /* AIX PS/2 does not supply statfs.  */
 
 int
-statfs (char *path, struct statfs *fsb)
+statfs (char *file, struct statfs *fsb)
 {
   struct stat stats;
   struct dustat fsd;
 
-  if (stat (path, &stats))
+  if (stat (file, &stats) != 0)
     return -1;
   if (dustat (stats.st_dev, 0, &fsd, sizeof (fsd)))
     return -1;
index 2d4172a39fbcac63a03b5d35f4525a68f5468b04..f3eda2d092fa5d0c6cc4fbb98dcdfa06533baffa 100644 (file)
@@ -1,6 +1,6 @@
 /* fsusage.h -- declarations for file system space usage info
 
-   Copyright (C) 1991, 1992, 1997, 2003, 2004 Free Software
+   Copyright (C) 1991, 1992, 1997, 2003, 2004, 2005 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -35,6 +35,6 @@ struct fs_usage
   uintmax_t fsu_ffree;         /* Free file nodes. */
 };
 
-int get_fs_usage (const char *path, const char *disk, struct fs_usage *fsp);
+int get_fs_usage (char const *file, char const *disk, struct fs_usage *fsp);
 
 #endif
index a0310c2e57c39394b5a25aa291ece09e771e25a6..0fb1a03c73dfe35eb19100e249e0967dc6026712 100644 (file)
@@ -21,7 +21,7 @@
 #include "cycle-check.h"
 #include "hash.h"
 
-/* Use these each of these to map a device/inode pair to an FTSENT.  */
+/* Use each of these to map a device/inode pair to an FTSENT.  */
 struct Active_dir
 {
   dev_t dev;
index a9abe0f10c702662cdd7877fa80cb4b3b9612ff5..d3bef85f3823fbdbd80880566928c560f7f74475 100644 (file)
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -244,8 +244,8 @@ fts_open (char * const *argv,
                SET(FTS_NOCHDIR);
 
        /*
-        * Start out with 1K of path space, and enough, in any case,
-        * to hold the user's paths.
+        * Start out with 1K of file name space, and enough, in any case,
+        * to hold the user's file names.
         */
 #ifndef MAXPATHLEN
 # define MAXPATHLEN 1024
@@ -260,7 +260,7 @@ fts_open (char * const *argv,
 
        /* Allocate/initialize root(s). */
        for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) {
-               /* Don't allow zero-length paths. */
+               /* Don't allow zero-length file names. */
                if ((len = strlen(*argv)) == 0) {
                        __set_errno (ENOENT);
                        goto mem3;
@@ -311,7 +311,7 @@ fts_open (char * const *argv,
 
        /*
         * If using chdir(2), grab a file descriptor pointing to dot to ensure
-        * that we can get back here; this could be avoided for some paths,
+        * that we can get back here; this could be avoided for some file names,
         * but almost certainly not worth the effort.  Slashes, symbolic links,
         * and ".." are all fairly nasty problems.  Note, if we can't get the
         * descriptor we run anyway, just more slowly.
@@ -341,7 +341,7 @@ fts_load (FTS *sp, register FTSENT *p)
         * actually enter the directory until after the preorder visit, set
         * the fts_accpath field specially so the chdir gets done to the right
         * place and the user can access the first node.  From fts_open it's
-        * known that the path will fit.
+        * known that the file name will fit.
         */
        len = p->fts_pathlen = p->fts_namelen;
        memmove(sp->fts_path, p->fts_name, len + 1);
@@ -374,7 +374,7 @@ fts_close (FTS *sp)
                free(p);
        }
 
-       /* Free up child linked list, sort array, path buffer. */
+       /* Free up child linked list, sort array, file name buffer. */
        if (sp->fts_child)
                fts_lfree(sp->fts_child);
        if (sp->fts_array)
@@ -403,8 +403,8 @@ fts_close (FTS *sp)
 }
 
 /*
- * Special case of "/" at the end of the path so that slashes aren't
- * appended which would cause paths to be written as "....//foo".
+ * Special case of "/" at the end of the file name so that slashes aren't
+ * appended which would cause file names to be written as "....//foo".
  */
 #define NAPPEND(p)                                                     \
        (p->fts_path[p->fts_pathlen - 1] == '/'                         \
@@ -524,7 +524,8 @@ next:       tmp = p;
 
                /*
                 * If reached the top, return to the original directory (or
-                * the root of the tree), and load the paths for the next root.
+                * the root of the tree), and load the file names for the next
+                * root.
                 */
                if (p->fts_level == FTS_ROOTLEVEL) {
                        if (FCHDIR(sp, sp->fts_rfd)) {
@@ -585,7 +586,7 @@ check_for_dir:
                return (sp->fts_cur = NULL);
        }
 
-       /* NUL terminate the pathname. */
+       /* NUL terminate the file name.  */
        sp->fts_path[p->fts_pathlen] = '\0';
 
        /*
@@ -685,8 +686,8 @@ fts_children (register FTS *sp, int instr)
                instr = BCHILD;
 
        /*
-        * If using chdir on a relative path and called BEFORE fts_read does
-        * its chdir to the root of a traversal, we can lose -- we need to
+        * If using chdir on a relative file name and called BEFORE fts_read
+        * does its chdir to the root of a traversal, we can lose -- we need to
         * chdir into the subdirectory, and we don't know where the current
         * directory is, so we can't get back so that the upcoming chdir by
         * fts_read will work.
@@ -753,7 +754,7 @@ fts_build (register FTS *sp, int type)
        else
                oflag = DTF_HIDEW|DTF_NODUP|DTF_REWIND;
 #else
-# define __opendir2(path, flag) opendir(path)
+# define __opendir2(file, flag) opendir(file)
 #endif
        if ((dirp = __opendir2(cur->fts_accpath, oflag)) == NULL) {
                if (type == BREAD) {
@@ -787,7 +788,7 @@ fts_build (register FTS *sp, int type)
         * but set a flag so we don't chdir after the post-order visit.
         * We won't be able to stat anything, but we can still return the
         * names themselves.  Note, that since fts_read won't be able to
-        * chdir into the directory, it will have to return different path
+        * chdir into the directory, it will have to return different file
         * names than before, i.e. "a/b" instead of "b".  Since the node
         * has already been visited in pre-order, have to wait until the
         * post-order visit to return the error.  There is a special case
@@ -813,13 +814,13 @@ fts_build (register FTS *sp, int type)
 
        /*
         * Figure out the max file name length that can be stored in the
-        * current path -- the inner loop allocates more path as necessary.
+        * current buffer -- the inner loop allocates more space as necessary.
         * We really wouldn't have to do the maxlen calculations here, we
-        * could do them in fts_read before returning the path, but it's a
+        * could do them in fts_read before returning the name, but it's a
         * lot easier here since the length is part of the dirent structure.
         *
         * If not changing directories set a pointer so that can just append
-        * each new name into the path.
+        * each new component into the file name.
         */
        len = NAPPEND(cur);
        if (ISSET(FTS_NOCHDIR)) {
@@ -846,7 +847,7 @@ fts_build (register FTS *sp, int type)
                        oldaddr = sp->fts_path;
                        if (! fts_palloc(sp, NAMLEN (dp) + len + 1)) {
                                /*
-                                * No more memory for path or structures.  Save
+                                * No more memory.  Save
                                 * errno, free up the current structure and the
                                 * structures already allocated.
                                 */
@@ -873,7 +874,7 @@ mem1:                               saved_errno = errno;
                if (new_len < len) {
                        /*
                         * In the unlikely even that we would end up
-                        * with a path longer than SIZE_MAX, free up
+                        * with a file name longer than SIZE_MAX, free up
                         * the current structure and the structures already
                         * allocated, then error out with ENAMETOOLONG.
                         */
@@ -940,14 +941,14 @@ mem1:                             saved_errno = errno;
                closedir(dirp);
 
        /*
-        * If realloc() changed the address of the path, adjust the
+        * If realloc() changed the address of the file name, adjust the
         * addresses for the rest of the tree and the dir list.
         */
        if (doadjust)
                fts_padjust(sp, head);
 
        /*
-        * If not changing directories, reset the path back to original
+        * If not changing directories, reset the file name back to original
         * state.
         */
        if (ISSET(FTS_NOCHDIR)) {
@@ -959,7 +960,7 @@ mem1:                               saved_errno = errno;
        /*
         * If descended after called from fts_children or after called from
         * fts_read and nothing found, get back.  At the root level we use
-        * the saved fd; if one of fts_open()'s arguments is a relative path
+        * the saved fd; if one of fts_open()'s arguments is a relative name
         * to an empty directory, we wind up here with no other way back.  If
         * can't get back, we're done.
         */
@@ -1226,10 +1227,11 @@ fts_lfree (register FTSENT *head)
 }
 
 /*
- * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
- * Most systems will allow creation of paths much longer than MAXPATHLEN, even
- * though the kernel won't resolve them.  Add the size (not just what's needed)
- * plus 256 bytes so don't realloc the path 2 bytes at a time.
+ * Allow essentially unlimited file name lengths; find, rm, ls should
+ * all work on any tree.  Most systems will allow creation of file
+ * names much longer than MAXPATHLEN, even though the kernel won't
+ * resolve them.  Add the size (not just what's needed) plus 256 bytes
+ * so don't realloc the file name 2 bytes at a time.
  */
 static bool
 internal_function
@@ -1262,8 +1264,8 @@ fts_palloc (FTS *sp, size_t more)
 }
 
 /*
- * When the path is realloc'd, have to fix all of the pointers in structures
- * already returned.
+ * When the file name is realloc'd, have to fix all of the pointers in
+ *  structures already returned.
  */
 static void
 internal_function
@@ -1303,13 +1305,13 @@ fts_maxarglen (char * const *argv)
 }
 
 /*
- * Change to dir specified by fd or path without getting
+ * Change to dir specified by fd or file name without getting
  * tricked by someone changing the world out from underneath us.
  * Assumes p->fts_statp->st_dev and p->fts_statp->st_ino are filled in.
  */
 static int
 internal_function
-fts_safe_changedir (FTS *sp, FTSENT *p, int fd, char const *path)
+fts_safe_changedir (FTS *sp, FTSENT *p, int fd, char const *dir)
 {
        int ret, oerrno, newfd;
        struct stat sb;
@@ -1317,7 +1319,7 @@ fts_safe_changedir (FTS *sp, FTSENT *p, int fd, char const *path)
        newfd = fd;
        if (ISSET(FTS_NOCHDIR))
                return (0);
-       if (fd < 0 && (newfd = fd_safer (diropen (path))) < 0)
+       if (fd < 0 && (newfd = fd_safer (diropen (dir))) < 0)
                return (-1);
        if (fstat(newfd, &sb)) {
                ret = -1;
index 954ba569ba01407f57b678c6e01d81c304008589..4bf903bd3f267f95e00eb00ffe6dacadbe2613b0 100644 (file)
@@ -71,7 +71,7 @@ typedef struct {
        struct _ftsent *fts_child;      /* linked list of children */
        struct _ftsent **fts_array;     /* sort array */
        dev_t fts_dev;                  /* starting device # */
-       char *fts_path;                 /* path for this descent */
+       char *fts_path;                 /* file name for this descent */
        int fts_rfd;                    /* fd for root */
        size_t fts_pathlen;             /* sizeof(path) */
        size_t fts_nitems;                      /* elements in the sort array */
@@ -135,8 +135,8 @@ typedef struct _ftsent {
        struct _ftsent *fts_link;       /* next file in directory */
        long fts_number;                /* local numeric value */
        void *fts_pointer;              /* local address value */
-       char *fts_accpath;              /* access path */
-       char *fts_path;                 /* root path; == fts_fts->fts_path */
+       char *fts_accpath;              /* access file name */
+       char *fts_path;                 /* root name; == fts_fts->fts_path */
        int fts_errno;                  /* errno for this node */
        int fts_symfd;                  /* fd for symlink */
        size_t fts_pathlen;             /* strlen(fts_path) */
index d12b6c9076e275329d522728f3a4aae7902470f4..94e5ba3b551aef0f1e0c6e2d4d6ac242bfd33bb7 100644 (file)
@@ -1,5 +1,5 @@
-/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2004 Free Software Foundation,
-   Inc.
+/* Copyright (C) 1991,92,93,94,95,96,97,98,99,2004,2005 Free Software
+   Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
 # define __readdir readdir
 #endif
 \f
-/* Get the pathname of the current working directory, and put it in SIZE
+/* Get the name of the current working directory, and put it in SIZE
    bytes of BUF.  Returns NULL if the directory couldn't be determined or
    SIZE was too small.  If successful, returns BUF.  In GNU, if BUF is
    NULL, an array is allocated with `malloc'; the array is SIZE bytes long,
@@ -147,8 +147,8 @@ __getcwd (char *buf, size_t size)
   DIR *dirstream = NULL;
   dev_t rootdev, thisdev;
   ino_t rootino, thisino;
-  char *path;
-  register char *pathp;
+  char *dir;
+  register char *dirp;
   struct stat st;
   size_t allocated = size;
   size_t used;
@@ -161,9 +161,9 @@ __getcwd (char *buf, size_t size)
      So trust the system getcwd's results unless they look
      suspicious.  */
 # undef getcwd
-  path = getcwd (buf, size);
-  if (path || (errno != ERANGE && !is_ENAMETOOLONG (errno) && errno != ENOENT))
-    return path;
+  dir = getcwd (buf, size);
+  if (dir || (errno != ERANGE && !is_ENAMETOOLONG (errno) && errno != ENOENT))
+    return dir;
 #endif
 
   if (size == 0)
@@ -179,15 +179,15 @@ __getcwd (char *buf, size_t size)
 
   if (buf == NULL)
     {
-      path = malloc (allocated);
-      if (path == NULL)
+      dir = malloc (allocated);
+      if (dir == NULL)
        return NULL;
     }
   else
-    path = buf;
+    dir = buf;
 
-  pathp = path + allocated;
-  *--pathp = '\0';
+  dirp = dir + allocated;
+  *--dirp = '\0';
 
   if (__lstat (".", &st) < 0)
     goto lose;
@@ -318,10 +318,10 @@ __getcwd (char *buf, size_t size)
        }
       else
        {
-         size_t pathroom = pathp - path;
+         size_t dirroom = dirp - dir;
          size_t namlen = _D_EXACT_NAMLEN (d);
 
-         if (pathroom <= namlen)
+         if (dirroom <= namlen)
            {
              if (size != 0)
                {
@@ -335,20 +335,20 @@ __getcwd (char *buf, size_t size)
 
                  allocated += MAX (allocated, namlen);
                  if (allocated < oldsize
-                     || ! (tmp = realloc (path, allocated)))
+                     || ! (tmp = realloc (dir, allocated)))
                    goto memory_exhausted;
 
                  /* Move current contents up to the end of the buffer.
                     This is guaranteed to be non-overlapping.  */
-                 pathp = memcpy (tmp + allocated - (oldsize - pathroom),
-                                 tmp + pathroom,
-                                 oldsize - pathroom);
-                 path = tmp;
+                 dirp = memcpy (tmp + allocated - (oldsize - dirroom),
+                                tmp + dirroom,
+                                oldsize - dirroom);
+                 dir = tmp;
                }
            }
-         pathp -= namlen;
-         memcpy (pathp, d->d_name, namlen);
-         *--pathp = '/';
+         dirp -= namlen;
+         memcpy (dirp, d->d_name, namlen);
+         *--dirp = '/';
        }
 
       thisdev = dotdev;
@@ -361,25 +361,25 @@ __getcwd (char *buf, size_t size)
       goto lose;
     }
 
-  if (pathp == &path[allocated - 1])
-    *--pathp = '/';
+  if (dirp == &dir[allocated - 1])
+    *--dirp = '/';
 
 #ifndef AT_FDCWD
   if (dotlist != dots)
     free (dotlist);
 #endif
 
-  used = path + allocated - pathp;
-  memmove (path, pathp, used);
+  used = dir + allocated - dirp;
+  memmove (dir, dirp, used);
 
   if (buf == NULL && size == 0)
     /* Ensure that the buffer is only as large as necessary.  */
-    buf = realloc (path, used);
+    buf = realloc (dir, used);
 
   if (buf == NULL)
     /* Either buf was NULL all along, or `realloc' failed but
        we still have the original string.  */
-    buf = path;
+    buf = dir;
 
   return buf;
 
@@ -398,7 +398,7 @@ __getcwd (char *buf, size_t size)
       free (dotlist);
 #endif
     if (buf == NULL)
-      free (path);
+      free (dir);
     __set_errno (save);
   }
   return NULL;
index 6be6e371663cc0cd25afd39fe1ce88835fedb303..8fe542fbb1ce520e7fdfb1da492e0d04a3b62da2 100644 (file)
@@ -32,7 +32,7 @@
                                AC_CHECK_FUNCS(pstat_getdynamic) in your
                                configure.in file.
    FIXUP_KERNEL_SYMBOL_ADDR()  Adjust address in returned struct nlist.
-   KERNEL_FILE                 Pathname of the kernel to nlist.
+   KERNEL_FILE                 Name of the kernel file to nlist.
    LDAV_CVT()                  Scale the load average from the kernel.
                                Returns a double.
    LDAV_SYMBOL                 Name of kernel symbol giving load average.
index 87c85d8099272815551e704056d90c3230a6a272..b3de8bbaf1838b81f73712f9ce051a0ff420fa14 100644 (file)
@@ -1,6 +1,7 @@
 /* idcache.c -- map user and group IDs, cached for speed
-   Copyright (C) 1985, 1988, 1989, 1990, 1997, 1998, 2003 Free Software
-   Foundation, Inc.
+
+   Copyright (C) 1985, 1988, 1989, 1990, 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
 
 #include "xalloc.h"
 
-#ifndef _POSIX_VERSION
-struct passwd *getpwuid ();
-struct passwd *getpwnam ();
-struct group *getgrgid ();
-struct group *getgrnam ();
-#endif
-
 #ifdef __DJGPP__
 static char digits[] = "0123456789";
 #endif
diff --git a/lib/makepath.c b/lib/makepath.c
deleted file mode 100644 (file)
index 19ad1f4..0000000
+++ /dev/null
@@ -1,398 +0,0 @@
-/* makepath.c -- Ensure that a directory path exists.
-
-   Copyright (C) 1990, 1997, 1998, 1999, 2000, 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
-   the Free Software Foundation; either version 2, 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
-   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.  */
-
-/* Written by David MacKenzie <djm@gnu.ai.mit.edu> and Jim Meyering.  */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "makepath.h"
-
-#include <alloca.h>
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-
-#include "gettext.h"
-#define _(msgid) gettext (msgid)
-
-#include "save-cwd.h"
-#include "dirname.h"
-#include "error.h"
-#include "quote.h"
-#include "stat-macros.h"
-
-#define WX_USR (S_IWUSR | S_IXUSR)
-
-#define CLEANUP_CWD                                    \
-  do                                                   \
-    {                                                  \
-      /* We're done operating on basename_dir.         \
-        Restore working directory.  */                 \
-      if (do_chdir)                                    \
-       {                                               \
-         if (restore_cwd (&cwd) != 0)                  \
-           {                                           \
-             int _saved_errno = errno;                 \
-             error (0, errno,                          \
-               _("failed to return to initial working directory")); \
-             free_cwd (&cwd);                          \
-             errno = _saved_errno;                     \
-             return 1;                                 \
-           }                                           \
-         free_cwd (&cwd);                              \
-       }                                               \
-    }                                                  \
-  while (0)
-
-#define CLEANUP                                                \
-  do                                                   \
-    {                                                  \
-      umask (oldmask);                                 \
-      CLEANUP_CWD;                                     \
-    }                                                  \
-  while (0)
-
-/* Attempt to create directory DIR (aka DIRPATH) with the specified MODE.
-   If CREATED_DIR_P is non-NULL, set *CREATED_DIR_P if this
-   function creates DIR and clear it otherwise.  Give a diagnostic and
-   return false if DIR cannot be created or cannot be determined to
-   exist already.  Use DIRPATH in any diagnostic, not DIR.
-   Note that if DIR already exists, this function returns true
-   (indicating success) and clears *CREATED_DIR_P.  */
-
-bool
-make_dir (const char *dir, const char *dirpath, mode_t mode,
-         bool *created_dir_p)
-{
-  bool ok = true;
-  bool created_dir;
-
-  created_dir = (mkdir (dir, mode) == 0);
-
-  if (!created_dir)
-    {
-      struct stat stats;
-      int saved_errno = errno;
-
-      /* The mkdir and stat calls below may appear to be reversed.
-        They are not.  It is important to call mkdir first and then to
-        call stat (to distinguish the three cases) only if mkdir fails.
-        The alternative to this approach is to `stat' each directory,
-        then to call mkdir if it doesn't exist.  But if some other process
-        were to create the directory between the stat & mkdir, the mkdir
-        would fail with EEXIST.  */
-
-      if (stat (dir, &stats))
-       {
-         error (0, saved_errno, _("cannot create directory %s"),
-                quote (dirpath));
-         ok = false;
-       }
-      else if (!S_ISDIR (stats.st_mode))
-       {
-         error (0, 0, _("%s exists but is not a directory"), quote (dirpath));
-         ok = false;
-       }
-      else
-       {
-         /* DIR (aka DIRPATH) already exists and is a directory. */
-       }
-    }
-
-  if (created_dir_p)
-    *created_dir_p = created_dir;
-
-  return ok;
-}
-
-/* Ensure that the directory ARGPATH exists.
-
-   Create any leading directories that don't already exist, with
-   permissions PARENT_MODE.
-   If the last element of ARGPATH does not exist, create it as
-   a new directory with permissions MODE.
-   If OWNER and GROUP are non-negative, use them to set the UID and GID of
-   any created directories.
-   If VERBOSE_FMT_STRING is nonzero, use it as a printf format
-   string for printing a message after successfully making a directory,
-   with the name of the directory that was just made as an argument.
-   If PRESERVE_EXISTING is true and ARGPATH is an existing directory,
-   then do not attempt to set its permissions and ownership.
-
-   Return true iff ARGPATH exists as a directory with the proper
-   ownership and permissions when done.  */
-
-bool
-make_path (const char *argpath,
-          mode_t mode,
-          mode_t parent_mode,
-          uid_t owner,
-          gid_t group,
-          bool preserve_existing,
-          const char *verbose_fmt_string)
-{
-  struct stat stats;
-  bool retval = true;
-
-  if (stat (argpath, &stats))
-    {
-      char *slash;
-      mode_t tmp_mode;         /* Initial perms for leading dirs.  */
-      bool re_protect;         /* Should leading dirs be unwritable? */
-      struct ptr_list
-      {
-       char *dirname_end;
-       struct ptr_list *next;
-      };
-      struct ptr_list *p, *leading_dirs = NULL;
-      bool do_chdir;           /* Whether to chdir before each mkdir.  */
-      struct saved_cwd cwd;
-      char *basename_dir;
-      char *dirpath;
-
-      /* Temporarily relax umask in case it's overly restrictive.  */
-      mode_t oldmask = umask (0);
-
-      /* Make a copy of ARGPATH that we can scribble NULs on.  */
-      dirpath = (char *) alloca (strlen (argpath) + 1);
-      strcpy (dirpath, argpath);
-      strip_trailing_slashes (dirpath);
-
-      /* If leading directories shouldn't be writable or executable,
-        or should have set[ug]id or sticky bits set and we are setting
-        their owners, we need to fix their permissions after making them.  */
-      if (((parent_mode & WX_USR) != WX_USR)
-         || ((owner != (uid_t) -1 || group != (gid_t) -1)
-             && (parent_mode & (S_ISUID | S_ISGID | S_ISVTX)) != 0))
-       {
-         tmp_mode = S_IRWXU;
-         re_protect = true;
-       }
-      else
-       {
-         tmp_mode = parent_mode;
-         re_protect = false;
-       }
-
-      /* If we can record the current working directory, we may be able
-        to do the chdir optimization.  */
-      do_chdir = (save_cwd (&cwd) == 0);
-
-      /* If we've saved the cwd and DIRPATH is an absolute pathname,
-        we must chdir to `/' in order to enable the chdir optimization.
-         So if chdir ("/") fails, turn off the optimization.  */
-      if (do_chdir && dirpath[0] == '/')
-       {
-         /* POSIX says "//" might be special, so chdir to "//" if the
-            file name starts with exactly two slashes.  */
-         char const *root = "//" + (dirpath[1] != '/' || dirpath[2] == '/');
-         if (chdir (root) != 0)
-           do_chdir = false;
-       }
-
-      slash = dirpath;
-
-      /* Skip over leading slashes.  */
-      while (*slash == '/')
-       slash++;
-
-      while (1)
-       {
-         bool newly_created_dir;
-
-         /* slash points to the leftmost unprocessed component of dirpath.  */
-         basename_dir = slash;
-
-         slash = strchr (slash, '/');
-         if (slash == NULL)
-           break;
-
-         /* If we're *not* doing chdir before each mkdir, then we have to refer
-            to the target using the full (multi-component) directory name.  */
-         if (!do_chdir)
-           basename_dir = dirpath;
-
-         *slash = '\0';
-         if (! make_dir (basename_dir, dirpath, tmp_mode, &newly_created_dir))
-           {
-             CLEANUP;
-             return false;
-           }
-
-         if (newly_created_dir)
-           {
-             if (verbose_fmt_string)
-               error (0, 0, verbose_fmt_string, quote (dirpath));
-
-             if ((owner != (uid_t) -1 || group != (gid_t) -1)
-                 && chown (basename_dir, owner, group)
-#if defined AFS && defined EPERM
-                 && errno != EPERM
-#endif
-                 )
-               {
-                 error (0, errno, _("cannot change owner and/or group of %s"),
-                        quote (dirpath));
-                 CLEANUP;
-                 return false;
-               }
-
-             if (re_protect)
-               {
-                 struct ptr_list *new = (struct ptr_list *)
-                   alloca (sizeof (struct ptr_list));
-                 new->dirname_end = slash;
-                 new->next = leading_dirs;
-                 leading_dirs = new;
-               }
-           }
-
-         /* If we were able to save the initial working directory,
-            then we can use chdir to change into each directory before
-            creating an entry in that directory.  This avoids making
-            stat and mkdir process O(n^2) file name components.  */
-         if (do_chdir && chdir (basename_dir) < 0)
-           {
-             error (0, errno, _("cannot chdir to directory %s"),
-                    quote (dirpath));
-             CLEANUP;
-             return false;
-           }
-
-         *slash++ = '/';
-
-         /* Avoid unnecessary calls to `stat' when given
-            pathnames containing multiple adjacent slashes.  */
-         while (*slash == '/')
-           slash++;
-       }
-
-      if (!do_chdir)
-       basename_dir = dirpath;
-
-      /* Done creating leading directories.  Restore original umask.  */
-      umask (oldmask);
-
-      /* We're done making leading directories.
-        Create the final component of the path.  */
-
-      if (! make_dir (basename_dir, dirpath, mode, NULL))
-       {
-         CLEANUP;
-         return false;
-       }
-
-      if (verbose_fmt_string != NULL)
-       error (0, 0, verbose_fmt_string, quote (dirpath));
-
-      if (owner != (uid_t) -1 || group != (gid_t) -1)
-       {
-         if (chown (basename_dir, owner, group)
-#ifdef AFS
-             && errno != EPERM
-#endif
-             )
-           {
-             error (0, errno, _("cannot change owner and/or group of %s"),
-                    quote (dirpath));
-             retval = false;
-           }
-       }
-
-      /* The above chown may have turned off some permission bits in MODE.
-        Another reason we may have to use chmod here is that mkdir(2) is
-        required to honor only the file permission bits.  In particular,
-        it need not honor the `special' bits, so if MODE includes any
-        special bits, set them here.  */
-      if ((mode & ~S_IRWXUGO)
-         && chmod (basename_dir, mode))
-       {
-         error (0, errno, _("cannot change permissions of %s"),
-                quote (dirpath));
-         retval = false;
-       }
-
-      CLEANUP_CWD;
-
-      /* If the mode for leading directories didn't include owner "wx"
-        privileges, we have to reset their protections to the correct
-        value.  */
-      for (p = leading_dirs; p != NULL; p = p->next)
-       {
-         *(p->dirname_end) = '\0';
-         if (chmod (dirpath, parent_mode))
-           {
-             error (0, errno, _("cannot change permissions of %s"),
-                    quote (dirpath));
-             retval = false;
-           }
-       }
-    }
-  else
-    {
-      /* We get here if the entire path already exists.  */
-
-      const char *dirpath = argpath;
-
-      if (!S_ISDIR (stats.st_mode))
-       {
-         error (0, 0, _("%s exists but is not a directory"), quote (dirpath));
-         return false;
-       }
-
-      if (!preserve_existing)
-       {
-         /* chown must precede chmod because on some systems,
-            chown clears the set[ug]id bits for non-superusers,
-            resulting in incorrect permissions.
-            On System V, users can give away files with chown and then not
-            be able to chmod them.  So don't give files away.  */
-
-         if ((owner != (uid_t) -1 || group != (gid_t) -1)
-             && chown (dirpath, owner, group)
-#ifdef AFS
-             && errno != EPERM
-#endif
-             )
-           {
-             error (0, errno, _("cannot change owner and/or group of %s"),
-                    quote (dirpath));
-             retval = false;
-           }
-         if (chmod (dirpath, mode))
-           {
-             error (0, errno, _("cannot change permissions of %s"),
-                                quote (dirpath));
-             retval = false;
-           }
-       }
-    }
-
-  return retval;
-}
diff --git a/lib/makepath.h b/lib/makepath.h
deleted file mode 100644 (file)
index 1fd432c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/* makepath.c -- Ensure that a directory path exists.
-
-   Copyright (C) 1994, 1995, 1996, 1997, 2000, 2003, 2004 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
-   the Free Software Foundation; either version 2, 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
-   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.  */
-
-/* Written by David MacKenzie <djm@gnu.ai.mit.edu> and Jim Meyering.  */
-
-#include <stdbool.h>
-#include <sys/types.h>
-
-bool make_path (const char *argpath,
-               mode_t mode,
-               mode_t parent_mode,
-               uid_t owner,
-               gid_t group,
-               bool preserve_existing,
-               const char *verbose_fmt_string);
-
-bool make_dir (const char *dir,
-              const char *dirpath,
-              mode_t mode,
-              bool *created_dir_p);
diff --git a/lib/mkdir-p.c b/lib/mkdir-p.c
new file mode 100644 (file)
index 0000000..433d871
--- /dev/null
@@ -0,0 +1,398 @@
+/* mkdir-p.c -- Ensure that a directory and its parents exist.
+
+   Copyright (C) 1990, 1997, 1998, 1999, 2000, 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
+   the Free Software Foundation; either version 2, 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
+   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.  */
+
+/* Written by David MacKenzie <djm@gnu.ai.mit.edu> and Jim Meyering.  */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "mkdir-p.h"
+
+#include <alloca.h>
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+#include "save-cwd.h"
+#include "dirname.h"
+#include "error.h"
+#include "quote.h"
+#include "stat-macros.h"
+
+#define WX_USR (S_IWUSR | S_IXUSR)
+
+#define CLEANUP_CWD                                    \
+  do                                                   \
+    {                                                  \
+      /* We're done operating on basename_dir.         \
+        Restore working directory.  */                 \
+      if (do_chdir)                                    \
+       {                                               \
+         if (restore_cwd (&cwd) != 0)                  \
+           {                                           \
+             int _saved_errno = errno;                 \
+             error (0, errno,                          \
+               _("failed to return to initial working directory")); \
+             free_cwd (&cwd);                          \
+             errno = _saved_errno;                     \
+             return 1;                                 \
+           }                                           \
+         free_cwd (&cwd);                              \
+       }                                               \
+    }                                                  \
+  while (0)
+
+#define CLEANUP                                                \
+  do                                                   \
+    {                                                  \
+      umask (oldmask);                                 \
+      CLEANUP_CWD;                                     \
+    }                                                  \
+  while (0)
+
+/* Attempt to create directory DIR (aka FULLDIR) with the specified MODE.
+   If CREATED_DIR_P is non-NULL, set *CREATED_DIR_P if this
+   function creates DIR and clear it otherwise.  Give a diagnostic and
+   return false if DIR cannot be created or cannot be determined to
+   exist already.  Use FULLDIR in any diagnostic, not DIR.
+   Note that if DIR already exists, this function returns true
+   (indicating success) and clears *CREATED_DIR_P.  */
+
+bool
+make_dir (char const *dir, char const *fulldir, mode_t mode,
+         bool *created_dir_p)
+{
+  bool ok = true;
+  bool created_dir;
+
+  created_dir = (mkdir (dir, mode) == 0);
+
+  if (!created_dir)
+    {
+      struct stat stats;
+      int saved_errno = errno;
+
+      /* The mkdir and stat calls below may appear to be reversed.
+        They are not.  It is important to call mkdir first and then to
+        call stat (to distinguish the three cases) only if mkdir fails.
+        The alternative to this approach is to `stat' each directory,
+        then to call mkdir if it doesn't exist.  But if some other process
+        were to create the directory between the stat & mkdir, the mkdir
+        would fail with EEXIST.  */
+
+      if (stat (dir, &stats))
+       {
+         error (0, saved_errno, _("cannot create directory %s"),
+                quote (fulldir));
+         ok = false;
+       }
+      else if (!S_ISDIR (stats.st_mode))
+       {
+         error (0, 0, _("%s exists but is not a directory"), quote (fulldir));
+         ok = false;
+       }
+      else
+       {
+         /* DIR (aka FULLDIR) already exists and is a directory. */
+       }
+    }
+
+  if (created_dir_p)
+    *created_dir_p = created_dir;
+
+  return ok;
+}
+
+/* Ensure that the directory ARG exists.
+
+   Create any leading directories that don't already exist, with
+   permissions PARENT_MODE.
+   If the last element of ARG does not exist, create it as
+   a new directory with permissions MODE.
+   If OWNER and GROUP are non-negative, use them to set the UID and GID of
+   any created directories.
+   If VERBOSE_FMT_STRING is nonzero, use it as a printf format
+   string for printing a message after successfully making a directory,
+   with the name of the directory that was just made as an argument.
+   If PRESERVE_EXISTING is true and ARG is an existing directory,
+   then do not attempt to set its permissions and ownership.
+
+   Return true iff ARG exists as a directory with the proper
+   ownership and permissions when done.  */
+
+bool
+make_dir_parents (char const *arg,
+                 mode_t mode,
+                 mode_t parent_mode,
+                 uid_t owner,
+                 gid_t group,
+                 bool preserve_existing,
+                 char const *verbose_fmt_string)
+{
+  struct stat stats;
+  bool retval = true;
+
+  if (stat (arg, &stats) != 0)
+    {
+      char *slash;
+      mode_t tmp_mode;         /* Initial perms for leading dirs.  */
+      bool re_protect;         /* Should leading dirs be unwritable? */
+      struct ptr_list
+      {
+       char *dirname_end;
+       struct ptr_list *next;
+      };
+      struct ptr_list *p, *leading_dirs = NULL;
+      bool do_chdir;           /* Whether to chdir before each mkdir.  */
+      struct saved_cwd cwd;
+      char *basename_dir;
+      char *dir;
+
+      /* Temporarily relax umask in case it's overly restrictive.  */
+      mode_t oldmask = umask (0);
+
+      /* Make a copy of ARG that we can scribble NULs on.  */
+      dir = (char *) alloca (strlen (arg) + 1);
+      strcpy (dir, arg);
+      strip_trailing_slashes (dir);
+
+      /* If leading directories shouldn't be writable or executable,
+        or should have set[ug]id or sticky bits set and we are setting
+        their owners, we need to fix their permissions after making them.  */
+      if (((parent_mode & WX_USR) != WX_USR)
+         || ((owner != (uid_t) -1 || group != (gid_t) -1)
+             && (parent_mode & (S_ISUID | S_ISGID | S_ISVTX)) != 0))
+       {
+         tmp_mode = S_IRWXU;
+         re_protect = true;
+       }
+      else
+       {
+         tmp_mode = parent_mode;
+         re_protect = false;
+       }
+
+      /* If we can record the current working directory, we may be able
+        to do the chdir optimization.  */
+      do_chdir = (save_cwd (&cwd) == 0);
+
+      /* If we've saved the cwd and DIR is an absolute file name,
+        we must chdir to `/' in order to enable the chdir optimization.
+         So if chdir ("/") fails, turn off the optimization.  */
+      if (do_chdir && dir[0] == '/')
+       {
+         /* POSIX says "//" might be special, so chdir to "//" if the
+            file name starts with exactly two slashes.  */
+         char const *root = "//" + (dir[1] != '/' || dir[2] == '/');
+         if (chdir (root) != 0)
+           do_chdir = false;
+       }
+
+      slash = dir;
+
+      /* Skip over leading slashes.  */
+      while (*slash == '/')
+       slash++;
+
+      while (1)
+       {
+         bool newly_created_dir;
+
+         /* slash points to the leftmost unprocessed component of dir.  */
+         basename_dir = slash;
+
+         slash = strchr (slash, '/');
+         if (slash == NULL)
+           break;
+
+         /* If we're *not* doing chdir before each mkdir, then we have to refer
+            to the target using the full (multi-component) directory name.  */
+         if (!do_chdir)
+           basename_dir = dir;
+
+         *slash = '\0';
+         if (! make_dir (basename_dir, dir, tmp_mode, &newly_created_dir))
+           {
+             CLEANUP;
+             return false;
+           }
+
+         if (newly_created_dir)
+           {
+             if (verbose_fmt_string)
+               error (0, 0, verbose_fmt_string, quote (dir));
+
+             if ((owner != (uid_t) -1 || group != (gid_t) -1)
+                 && chown (basename_dir, owner, group)
+#if defined AFS && defined EPERM
+                 && errno != EPERM
+#endif
+                 )
+               {
+                 error (0, errno, _("cannot change owner and/or group of %s"),
+                        quote (dir));
+                 CLEANUP;
+                 return false;
+               }
+
+             if (re_protect)
+               {
+                 struct ptr_list *new = (struct ptr_list *)
+                   alloca (sizeof (struct ptr_list));
+                 new->dirname_end = slash;
+                 new->next = leading_dirs;
+                 leading_dirs = new;
+               }
+           }
+
+         /* If we were able to save the initial working directory,
+            then we can use chdir to change into each directory before
+            creating an entry in that directory.  This avoids making
+            stat and mkdir process O(n^2) file name components.  */
+         if (do_chdir && chdir (basename_dir) < 0)
+           {
+             error (0, errno, _("cannot chdir to directory %s"),
+                    quote (dir));
+             CLEANUP;
+             return false;
+           }
+
+         *slash++ = '/';
+
+         /* Avoid unnecessary calls to `stat' when given
+            file names containing multiple adjacent slashes.  */
+         while (*slash == '/')
+           slash++;
+       }
+
+      if (!do_chdir)
+       basename_dir = dir;
+
+      /* Done creating leading directories.  Restore original umask.  */
+      umask (oldmask);
+
+      /* We're done making leading directories.
+        Create the final component of the file name.  */
+
+      if (! make_dir (basename_dir, dir, mode, NULL))
+       {
+         CLEANUP;
+         return false;
+       }
+
+      if (verbose_fmt_string != NULL)
+       error (0, 0, verbose_fmt_string, quote (dir));
+
+      if (owner != (uid_t) -1 || group != (gid_t) -1)
+       {
+         if (chown (basename_dir, owner, group)
+#ifdef AFS
+             && errno != EPERM
+#endif
+             )
+           {
+             error (0, errno, _("cannot change owner and/or group of %s"),
+                    quote (dir));
+             retval = false;
+           }
+       }
+
+      /* The above chown may have turned off some permission bits in MODE.
+        Another reason we may have to use chmod here is that mkdir(2) is
+        required to honor only the file permission bits.  In particular,
+        it need not honor the `special' bits, so if MODE includes any
+        special bits, set them here.  */
+      if ((mode & ~S_IRWXUGO)
+         && chmod (basename_dir, mode))
+       {
+         error (0, errno, _("cannot change permissions of %s"),
+                quote (dir));
+         retval = false;
+       }
+
+      CLEANUP_CWD;
+
+      /* If the mode for leading directories didn't include owner "wx"
+        privileges, we have to reset their protections to the correct
+        value.  */
+      for (p = leading_dirs; p != NULL; p = p->next)
+       {
+         *(p->dirname_end) = '\0';
+         if (chmod (dir, parent_mode) != 0)
+           {
+             error (0, errno, _("cannot change permissions of %s"),
+                    quote (dir));
+             retval = false;
+           }
+       }
+    }
+  else
+    {
+      /* We get here if the file already exists.  */
+
+      char const *dir = arg;
+
+      if (!S_ISDIR (stats.st_mode))
+       {
+         error (0, 0, _("%s exists but is not a directory"), quote (dir));
+         return false;
+       }
+
+      if (!preserve_existing)
+       {
+         /* chown must precede chmod because on some systems,
+            chown clears the set[ug]id bits for non-superusers,
+            resulting in incorrect permissions.
+            On System V, users can give away files with chown and then not
+            be able to chmod them.  So don't give files away.  */
+
+         if ((owner != (uid_t) -1 || group != (gid_t) -1)
+             && chown (dir, owner, group)
+#ifdef AFS
+             && errno != EPERM
+#endif
+             )
+           {
+             error (0, errno, _("cannot change owner and/or group of %s"),
+                    quote (dir));
+             retval = false;
+           }
+         if (chmod (dir, mode) != 0)
+           {
+             error (0, errno, _("cannot change permissions of %s"),
+                                quote (dir));
+             retval = false;
+           }
+       }
+    }
+
+  return retval;
+}
diff --git a/lib/mkdir-p.h b/lib/mkdir-p.h
new file mode 100644 (file)
index 0000000..1aef883
--- /dev/null
@@ -0,0 +1,36 @@
+/* mkdir-p.h -- Ensure that a directory and its parents exist.
+
+   Copyright (C) 1994, 1995, 1996, 1997, 2000, 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
+   the Free Software Foundation; either version 2, 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
+   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.  */
+
+/* Written by David MacKenzie <djm@gnu.ai.mit.edu> and Jim Meyering.  */
+
+#include <stdbool.h>
+#include <sys/types.h>
+
+bool make_dir_parents (char const *argname,
+                      mode_t mode,
+                      mode_t parent_mode,
+                      uid_t owner,
+                      gid_t group,
+                      bool preserve_existing,
+                      char const *verbose_fmt_string);
+
+bool make_dir (char const *dir,
+              char const *fulldir,
+              mode_t mode,
+              bool *created_dir_p);
index ab635e6b4a9da468d735b916baa11958a5a8a5bf..2683e4b8f7bfad5c078bef720334f961a95b83db 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2001, 2005 Free Software Foundation, Inc.
    This file is derived from the one in the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
@@ -33,7 +33,7 @@ int __gen_tempname ();
 
 /* Generate a unique temporary file name from TEMPLATE.
    The last six characters of TEMPLATE must be "XXXXXX";
-   they are replaced with a string that makes the filename unique.
+   they are replaced with a string that makes the file name unique.
    Then open the file and return a fd. */
 int
 rpl_mkstemp (char *template)
index 49dcf4247e3386ba0c0a3898fcdc0578a31234f6..129e0a438ee1342ed6e6a557624f6823d7db5a46 100644 (file)
@@ -755,16 +755,16 @@ read_file_system_list (bool need_fs_type)
        me = xmalloc (sizeof *me);
        if (vmp->vmt_flags & MNT_REMOTE)
          {
-           char *host, *path;
+           char *host, *dir;
 
            me->me_remote = 1;
-           /* Prepend the remote pathname.  */
+           /* Prepend the remote dirname.  */
            host = thisent + vmp->vmt_data[VMT_HOSTNAME].vmt_off;
-           path = thisent + vmp->vmt_data[VMT_OBJECT].vmt_off;
-           me->me_devname = xmalloc (strlen (host) + strlen (path) + 2);
+           dir = thisent + vmp->vmt_data[VMT_OBJECT].vmt_off;
+           me->me_devname = xmalloc (strlen (host) + strlen (dir) + 2);
            strcpy (me->me_devname, host);
            strcat (me->me_devname, ":");
-           strcat (me->me_devname, path);
+           strcat (me->me_devname, dir);
          }
        else
          {
index cacfe45cd50e4cb0ebdc1e487d16f36b7212f355..7f5a6f77ab4be6cfee2063d316d85c118508969b 100644 (file)
@@ -26,8 +26,8 @@
 /* A mount table entry. */
 struct mount_entry
 {
-  char *me_devname;            /* Device node pathname, including "/dev/". */
-  char *me_mountdir;           /* Mount point directory pathname. */
+  char *me_devname;            /* Device node name, including "/dev/". */
+  char *me_mountdir;           /* Mount point directory name. */
   char *me_type;               /* "nfs", "4.2", etc. */
   dev_t me_dev;                        /* Device number of me_mountdir. */
   unsigned int me_dummy : 1;   /* Nonzero for dummy file systems. */
index fe539de164f4f446a2c978e75eb71f4521cee95e..ec51b2d1376f0436ebfac5ff5776a7cf5725e9d5 100644 (file)
@@ -43,7 +43,7 @@
    Otherwise, upon failure, set errno and return -1, as openat does.
    Upon successful completion, return a file descriptor.  */
 int
-rpl_openat (int fd, char const *filename, int flags, ...)
+rpl_openat (int fd, char const *file, int flags, ...)
 {
   struct saved_cwd saved_cwd;
   int saved_errno;
@@ -62,8 +62,8 @@ rpl_openat (int fd, char const *filename, int flags, ...)
       va_end (arg);
     }
 
-  if (fd == AT_FDCWD || *filename == '/')
-    return open (filename, flags, mode);
+  if (fd == AT_FDCWD || *file == '/')
+    return open (file, flags, mode);
 
   if (save_cwd (&saved_cwd) != 0)
     error (exit_failure, errno,
@@ -77,7 +77,7 @@ rpl_openat (int fd, char const *filename, int flags, ...)
       return -1;
     }
 
-  new_fd = open (filename, flags, mode);
+  new_fd = open (file, flags, mode);
   saved_errno = errno;
 
   if (restore_cwd (&saved_cwd) != 0)
@@ -140,7 +140,7 @@ fdopendir (int fd)
    then give a diagnostic and exit nonzero.
    Otherwise, this function works just like Solaris' fstatat.  */
 int
-fstatat (int fd, char const *filename, struct stat *st, int flag)
+fstatat (int fd, char const *file, struct stat *st, int flag)
 {
   struct saved_cwd saved_cwd;
   int saved_errno;
@@ -148,8 +148,8 @@ fstatat (int fd, char const *filename, struct stat *st, int flag)
 
   if (fd == AT_FDCWD)
     return (flag == AT_SYMLINK_NOFOLLOW
-           ? lstat (filename, st)
-           : stat (filename, st));
+           ? lstat (file, st)
+           : stat (file, st));
 
   if (save_cwd (&saved_cwd) != 0)
     error (exit_failure, errno,
@@ -164,8 +164,8 @@ fstatat (int fd, char const *filename, struct stat *st, int flag)
     }
 
   err = (flag == AT_SYMLINK_NOFOLLOW
-        ? lstat (filename, st)
-        : stat (filename, st));
+        ? lstat (file, st)
+        : stat (file, st));
   saved_errno = errno;
 
   if (restore_cwd (&saved_cwd) != 0)
index d8db9cea51f06433dcb9b272989e024b540b1ddb..6639f732a0af6984f2e1b866398755ebe9d6bcfd 100644 (file)
 #  define __OPENAT_XCONCAT(x, y) __OPENAT_CONCAT (x, y)
 #  define __OPENAT_ID(y) __OPENAT_XCONCAT (__OPENAT_PREFIX, y)
 #  define openat __OPENAT_ID (openat)
-int openat (int fd, char const *filename, int flags, /* mode_t mode */ ...);
+int openat (int fd, char const *file, int flags, /* mode_t mode */ ...);
 #  define fdopendir __OPENAT_ID (fdopendir)
 DIR *fdopendir (int fd);
 #  define fstatat __OPENAT_ID (fstatat)
-int fstatat (int fd, char const *filename, struct stat *st, int flag);
+int fstatat (int fd, char const *file, struct stat *st, int flag);
 # endif
 
 #endif
diff --git a/lib/path-concat.c b/lib/path-concat.c
deleted file mode 100644 (file)
index 364081f..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/* path-concat.c -- concatenate two arbitrary pathnames
-
-   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 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
-   the Free Software Foundation; either version 2, 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
-   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.  */
-
-/* Written by Jim Meyering.  */
-
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-/* Specification.  */
-#include "path-concat.h"
-
-#include <string.h>
-
-#include "dirname.h"
-#include "xalloc.h"
-
-#if ! HAVE_MEMPCPY && ! defined mempcpy
-# define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
-#endif
-
-/* Return the longest suffix of F that is a relative file name.
-   If it has no such suffix, return the empty string.  */
-
-static char const *
-longest_relative_suffix (char const *f)
-{
-  for (f += FILE_SYSTEM_PREFIX_LEN (f); ISSLASH (*f); f++)
-    continue;
-  return f;
-}
-
-/* Concatenate two pathname components, DIR and ABASE, in
-   newly-allocated storage and return the result.
-   The resulting file name F is such that the commands "ls F" and "(cd
-   DIR; ls BASE)" refer to the same file, where BASE is ABASE with any
-   file system prefixes and leading separators removed.
-   Arrange for a directory separator if necessary between DIR and BASE
-   in the result, removing any redundant separators.
-   In any case, if BASE_IN_RESULT is non-NULL, set
-   *BASE_IN_RESULT to point to the copy of ABASE in the returned
-   concatenation.  However, if ABASE begins with more than one slash,
-   set *BASE_IN_RESULT to point to the sole corresponding slash that
-   is copied into the result buffer.
-
-   Report an error if memory is exhausted.  */
-
-char *
-path_concat (char const *dir, char const *abase, char **base_in_result)
-{
-  char const *dirbase = base_name (dir);
-  size_t dirbaselen = base_len (dirbase);
-  size_t dirlen = dirbase - dir + dirbaselen;
-  size_t needs_separator = (dirbaselen && ! ISSLASH (dirbase[dirbaselen - 1]));
-
-  char const *base = longest_relative_suffix (abase);
-  size_t baselen = strlen (base);
-
-  char *p_concat = xmalloc (dirlen + needs_separator + baselen + 1);
-  char *p;
-
-  p = mempcpy (p_concat, dir, dirlen);
-  *p = DIRECTORY_SEPARATOR;
-  p += needs_separator;
-
-  if (base_in_result)
-    *base_in_result = p - IS_ABSOLUTE_FILE_NAME (abase);
-
-  p = mempcpy (p, base, baselen);
-  *p = '\0';
-
-  return p_concat;
-}
-
-#ifdef TEST_PATH_CONCAT
-# include <stdlib.h>
-# include <stdio.h>
-int
-main ()
-{
-  static char const *const tests[][3] =
-    {
-      {"a", "b",   "a/b"},
-      {"a/", "b",  "a/b"},
-      {"a/", "/b", "a/b"},
-      {"a", "/b",  "a/b"},
-
-      {"/", "b",  "/b"},
-      {"/", "/b", "/b"},
-      {"/", "/",  "/"},
-      {"a", "/",  "a/"},   /* this might deserve a diagnostic */
-      {"/a", "/", "/a/"},  /* this might deserve a diagnostic */
-      {"a", "//b",  "a/b"},
-    };
-  size_t i;
-  bool fail = false;
-  for (i = 0; i < sizeof tests / sizeof tests[0]; i++)
-    {
-      char *base_in_result;
-      char const *const *t = tests[i];
-      char *res = path_concat (t[0], t[1], &base_in_result);
-      if (strcmp (res, t[2]) != 0)
-       {
-         printf ("got %s, expected %s\n", res, t[2]);
-         fail = true;
-       }
-    }
-  exit (fail ? EXIT_FAILURE : EXIT_SUCCESS);
-}
-#endif
diff --git a/lib/path-concat.h b/lib/path-concat.h
deleted file mode 100644 (file)
index 7121796..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Concatenate two arbitrary pathnames.
-
-   Copyright (C) 1996, 1997, 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
-   the Free Software Foundation; either version 2, 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
-   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.  */
-
-/* Written by Jim Meyering.  */
-
-#if ! defined PATH_CONCAT_H_
-# define PATH_CONCAT_H_
-
-char *path_concat (const char *dir, const char *base, char **base_in_result);
-
-#endif
index 48ba92a700ebd91060fff387d0715f27cc46eca2..613c56c0974ccead42c1797b94a3a43df2dcf0bb 100644 (file)
@@ -1,5 +1,5 @@
 /* Define PATH_MAX somehow.  Requires sys/types.h.
-   Copyright (C) 1992, 1999, 2001, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1999, 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
 #  include <unistd.h>
 # endif
 
-/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
-   PATH_MAX but might cause redefinition warnings when sys/param.h is
-   later included (as on MORE/BSD 4.3).  */
-# if defined _POSIX_VERSION || !defined __GNUC__
-#  include <limits.h>
-# endif
+# include <limits.h>
 
 # ifndef _POSIX_PATH_MAX
-#  define _POSIX_PATH_MAX 255
+#  define _POSIX_PATH_MAX 256
 # endif
 
 # if !defined PATH_MAX && defined _PC_PATH_MAX
index a6d91bd42bb52dd0f9b139079795e018c716744a..ca4472c650a2994c06693678e3b1c39d608bf59c 100644 (file)
@@ -72,7 +72,7 @@ desirable_utmp_entry (STRUCT_UTMP const *u, int options)
                || (kill (UT_PID (u), 0) < 0 && errno == ESRCH)));
 }
 
-/* Read the utmp entries corresponding to file FILENAME into freshly-
+/* Read the utmp entries corresponding to file FILE into freshly-
    malloc'd storage, set *UTMP_BUF to that pointer, set *N_ENTRIES to
    the number of entries, and return zero.  If there is any error,
    return -1, setting errno, and don't modify the parameters.
@@ -82,7 +82,7 @@ desirable_utmp_entry (STRUCT_UTMP const *u, int options)
 #ifdef UTMP_NAME_FUNCTION
 
 int
-read_utmp (const char *filename, size_t *n_entries, STRUCT_UTMP **utmp_buf,
+read_utmp (char const *file, size_t *n_entries, STRUCT_UTMP **utmp_buf,
           int options)
 {
   size_t n_read = 0;
@@ -94,7 +94,7 @@ read_utmp (const char *filename, size_t *n_entries, STRUCT_UTMP **utmp_buf,
      Solaris' utmpname returns 1 upon success -- which is contrary
      to what the GNU libc version does.  In addition, older GNU libc
      versions are actually void.   */
-  UTMP_NAME_FUNCTION (filename);
+  UTMP_NAME_FUNCTION (file);
 
   SET_UTMP_ENT ();
 
@@ -118,14 +118,14 @@ read_utmp (const char *filename, size_t *n_entries, STRUCT_UTMP **utmp_buf,
 #else
 
 int
-read_utmp (const char *filename, size_t *n_entries, STRUCT_UTMP **utmp_buf,
+read_utmp (char const *file, size_t *n_entries, STRUCT_UTMP **utmp_buf,
           int options)
 {
   size_t n_read = 0;
   size_t n_alloc = 0;
   STRUCT_UTMP *utmp = NULL;
   int saved_errno;
-  FILE *f = fopen (filename, "r");
+  FILE *f = fopen (file, "r");
 
   if (! f)
     return -1;
index 6cacc400e0e5670232b67213c0dc8fbf3f02c986..f5797ebe9efe29e6f12d0708341e0b27312b1198 100644 (file)
@@ -205,7 +205,7 @@ enum
   };
 
 char *extract_trimmed_name (const STRUCT_UTMP *ut);
-int read_utmp (const char *filename, size_t *n_entries, STRUCT_UTMP **utmp_buf,
+int read_utmp (char const *file, size_t *n_entries, STRUCT_UTMP **utmp_buf,
               int options);
 
 #endif /* __READUTMP_H__ */
index 44cc1d2929907e8f0b8b70adf4018f7151322c46..6f77fd09c977dbb238fd3500e397c4cf160aeb2b 100644 (file)
@@ -1,7 +1,7 @@
 /* Work around the bug in some systems whereby rename fails when the source
-   path has a trailing slash.  The rename functions of SunOS 4.1.1_U1 and
+   file has a trailing slash.  The rename functions of SunOS 4.1.1_U1 and
    mips-dec-ultrix4.4 have this bug.
-   Copyright (C) 2001-2003 Free Software Foundation, Inc.
+   Copyright (C) 2001, 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
 #include "dirname.h"
 #include "xalloc.h"
 
-/* Rename the file SRC_PATH to DST_PATH, removing any trailing
-   slashes from SRC_PATH.  Needed for SunOS 4.1.1_U1.  */
+/* Rename the file SRC to DST, removing any trailing
+   slashes from SRC.  Needed for SunOS 4.1.1_U1.  */
 
 int
-rpl_rename (const char *src_path, const char *dst_path)
+rpl_rename (char const *src, char const *dst)
 {
   char *src_temp;
   int ret_val;
-  size_t s_len = strlen (src_path);
+  size_t s_len = strlen (src);
 
-  if (s_len && src_path[s_len - 1] == '/')
+  if (s_len && src[s_len - 1] == '/')
     {
-      src_temp = xstrdup (src_path);
+      src_temp = xstrdup (src);
       strip_trailing_slashes (src_temp);
     }
   else
-    src_temp = (char *) src_path;
+    src_temp = (char *) src;
 
-  ret_val = rename (src_temp, dst_path);
+  ret_val = rename (src_temp, dst);
 
-  if (src_temp != src_path)
+  if (src_temp != src)
     free (src_temp);
 
   return ret_val;
index 73d8e43397bea8f992352ca2e05189e91245fd47..ad026a641bcda33dbfa5455fc1500e61498cba52 100644 (file)
@@ -1,6 +1,7 @@
 /* BSD compatible remove directory function for System V
 
-   Copyright (C) 1988, 1990, 1999, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1988, 1990, 1999, 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
 
 /* rmdir adapted from GNU tar.  */
 
-/* Remove directory DPATH.
+/* Remove directory DIR.
    Return 0 if successful, -1 if not.  */
 
 int
-rmdir (char const *dpath)
+rmdir (char const *dir)
 {
   pid_t cpid;
   int status;
   struct stat statbuf;
 
-  if (stat (dpath, &statbuf) != 0)
+  if (stat (dir, &statbuf) != 0)
     return -1;                 /* errno already set */
 
   if (!S_ISDIR (statbuf.st_mode))
@@ -54,7 +55,7 @@ rmdir (char const *dpath)
       return -1;               /* errno already set */
 
     case 0:                    /* child process */
-      execl ("/bin/rmdir", "rmdir", dpath, (char *) 0);
+      execl ("/bin/rmdir", "rmdir", dir, (char *) 0);
       _exit (1);
 
     default:                   /* parent process */
index ecbc58fdbeb69b1c47ade0dc980602189df32310..89ee47dd09c2f496ed8ca41587ce4f6f550ed843 100644 (file)
@@ -1,6 +1,6 @@
 /* Determine whether two file names refer to the same file.
 
-   Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004 Free
+   Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005 Free
    Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -72,7 +72,7 @@ same_name (const char *source, const char *dest)
   bool same = false;
 
 #if ! _POSIX_NO_TRUNC && HAVE_PATHCONF && defined _PC_NAME_MAX
-  /* This implementation silently truncates pathname components.  If
+  /* This implementation silently truncates components of file names.  If
      the base names might be truncated, check whether the truncated
      base names are the same, while checking the directories.  */
   size_t slen_max = HAVE_LONG_FILE_NAMES ? 255 : _POSIX_NAME_MAX;
index 73cc374f43d72cf47ec86da36d4061d52d62e48c..4eeda01939fad542ff1d58687b18475a040c175e 100644 (file)
@@ -1,6 +1,6 @@
 /* savedir.c -- save the list of files in a directory in a string
 
-   Copyright 1990, 1997, 1998, 1999, 2000, 2001, 2003, 2004 Free
+   Copyright 1990, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free
    Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -57,7 +57,7 @@
 
 #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.  */
index 1a472f50a2adc0d2398d140072a1a9465eb34d79..870a66f3877698722736e126a74df52d5baa30a0 100644 (file)
@@ -1,5 +1,6 @@
 /* stripslash.c -- remove redundant trailing slashes from a file name
-   Copyright (C) 1990, 2001, 2003, 2004 Free Software Foundation, Inc.
+
+   Copyright (C) 1990, 2001, 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
 
 #include "dirname.h"
 
-/* Remove trailing slashes from PATH.
+/* Remove trailing slashes from FILE.
    Return true if a trailing slash was removed.
-   This is useful when using filename completion from a shell that
+   This is useful when using file name completion from a shell that
    adds a "/" after directory names (such as tcsh and bash), because
    the Unix rename and rmdir system calls return an "Invalid argument" error
-   when given a path that ends in "/" (except for the root directory).  */
+   when given a file that ends in "/" (except for the root directory).  */
 
 bool
-strip_trailing_slashes (char *path)
+strip_trailing_slashes (char *file)
 {
-  char *base = base_name (path);
+  char *base = base_name (file);
   char *base_lim = base + base_len (base);
   bool had_slash = (*base_lim != '\0');
   *base_lim = '\0';
index 3de699b427b388a1cfddfcfa987319f882334f1e..eda6235aea69e069f82df4195d332af698072152 100644 (file)
@@ -78,8 +78,8 @@
 # define __mkdir mkdir
 # define __open open
 # define __open64 open
-# define __lxstat64(version, path, buf) lstat (path, buf)
-# define __xstat64(version, path, buf) stat (path, buf)
+# define __lxstat64(version, file, buf) lstat (file, buf)
+# define __xstat64(version, file, buf) stat (file, buf)
 #endif
 
 #if ! (HAVE___SECURE_GETENV || _LIBC)
@@ -185,7 +185,7 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
   return 0;
 }
 
-/* These are the characters used in temporary filenames.  */
+/* These are the characters used in temporary file names.  */
 static const char letters[] =
 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
 
index c3992d288e0ed79c8b1dca269ed70c0d66fcabc6..5f5c5bf43c8650ce389301aa360a10a08f8622e8 100644 (file)
 #define _(msgid) gettext (msgid)
 #define N_(msgid) msgid
 
-#ifndef _POSIX_VERSION
-struct passwd *getpwnam ();
-struct group *getgrnam ();
-struct group *getgrgid ();
-#endif
-
 #ifndef HAVE_ENDGRENT
 # define endgrent() ((void) 0)
 #endif
index 0e260757c69768cf1d5b05a994e5bd465705cd44..d56d2a6af40bcc362d602faf9b18c77902473065 100644 (file)
@@ -1,6 +1,6 @@
 /* xreadlink.c -- readlink wrapper to return the link name in malloc'd storage
 
-   Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2001, 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
@@ -45,7 +45,7 @@
 
 #include "xalloc.h"
 
-/* Call readlink to get the symbolic link value of FILENAME.
+/* Call readlink to get the symbolic link value of FILE.
    SIZE is a hint as to how long the link is expected to be;
    typically it is taken from st_size.  It need not be correct.
    Return a pointer to that NUL-terminated string in malloc'd storage.
@@ -54,7 +54,7 @@
    give a diagnostic and exit.  */
 
 char *
-xreadlink (char const *filename, size_t size)
+xreadlink (char const *file, size_t size)
 {
   /* The initial buffer size for the link value.  A power of 2
      detects arithmetic overflow earlier, but is not required.  */
@@ -63,7 +63,7 @@ xreadlink (char const *filename, size_t size)
   while (1)
     {
       char *buffer = xmalloc (buf_size);
-      ssize_t r = readlink (filename, buffer, buf_size);
+      ssize_t r = readlink (file, buffer, buf_size);
       size_t link_length = r;
 
       /* On AIX 5L v5.3 and HP-UX 11i v2 04/09, readlink returns -1
index 479d07b9d61404d55538795d462dbe4c45316f1a..7530e3db303ca530caac20a89c9d93794cc3af70 100644 (file)
@@ -1,3 +1,18 @@
+2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Sync from coreutils.
+       * mkdir-p.m4: Renamed from makepath.m4.
+       (gl_MKDIR_PARENTS): Renamed from gl_MAKEPATH.  All uses changed.
+       Rename files from makepath.c to mkdir-p.c, and from
+       makepath.h to mkdir-p.h.
+       * filenamecat.m4: Renamed from path-concat.m4.
+       (gl_FILE_NAME_CONCAT): Renamed from gl_PATH_CONCAT.  All uses changed.
+       Rename files from path-concat.c to filenamecat.c,
+       and from path-concat.h to filenamecat.h.
+       * getcwd-path-max.m4: Don't use "path" or "filename" to mean
+       "file name" in local variables or comments.
+       * rename.m4: Likewise.
+
 2005-06-01  Bruno Haible  <bruno@clisp.org>
 
        * csharp.m4: New file, from GNU gettext.
diff --git a/m4/filenamecat.m4 b/m4/filenamecat.m4
new file mode 100644 (file)
index 0000000..c75a57d
--- /dev/null
@@ -0,0 +1,14 @@
+# filenamecat.m4 serial 7
+dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FILE_NAME_CONCAT],
+[
+  AC_LIBSOURCES([filenamecat.c, filenamecat.h])
+  AC_LIBOBJ([filenamecat])
+
+  dnl Prerequisites of lib/filenamecat.c.
+  AC_CHECK_FUNCS_ONCE(mempcpy)
+])
index d632c42395b031903f5666570e955aeca6e6196a..74570dfffa6ca9c56fba4e14ca8019e0a79ba969 100644 (file)
@@ -1,5 +1,5 @@
-#serial 8
-# Check for several getcwd bugs with long paths.
+#serial 9
+# Check for several getcwd bugs with long file names.
 # If so, arrange to compile the wrapper function.
 
 # This is necessary for at least GNU libc on linux-2.4.19 and 2.4.20.
diff --git a/m4/makepath.m4 b/m4/makepath.m4
deleted file mode 100644 (file)
index b740843..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# makepath.m4 serial 7
-dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_MAKEPATH],
-[
-  AC_LIBSOURCES([makepath.c, makepath.h])
-  AC_LIBOBJ([makepath])
-
-  dnl Prerequisites of lib/makepath.c.
-  AC_REQUIRE([AC_FUNC_ALLOCA])
-  AC_CHECK_HEADERS_ONCE(unistd.h)
-  AC_REQUIRE([gl_AFS])
-])
diff --git a/m4/mkdir-p.m4 b/m4/mkdir-p.m4
new file mode 100644 (file)
index 0000000..a92e66a
--- /dev/null
@@ -0,0 +1,16 @@
+# mkdir-p.m4 serial 8
+dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_MKDIR_PARENTS],
+[
+  AC_LIBSOURCES([mkdir-p.c, mkdir-p.h])
+  AC_LIBOBJ([mkdir-p])
+
+  dnl Prerequisites of lib/mkdir-p.c.
+  AC_REQUIRE([AC_FUNC_ALLOCA])
+  AC_CHECK_HEADERS_ONCE(unistd.h)
+  AC_REQUIRE([gl_AFS])
+])
diff --git a/m4/path-concat.m4 b/m4/path-concat.m4
deleted file mode 100644 (file)
index 48a8db3..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# path-concat.m4 serial 6
-dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_PATH_CONCAT],
-[
-  AC_LIBSOURCES([path-concat.c, path-concat.h])
-  AC_LIBOBJ([path-concat])
-
-  dnl Prerequisites of lib/path-concat.c.
-  AC_CHECK_FUNCS_ONCE(mempcpy)
-])
index 7d5916036121852eb670da88439dff6d09b268b6..1c9e0e98e97580b2ced5beee21fa80e04a2a1b1d 100644 (file)
@@ -1,12 +1,12 @@
-#serial 7
+#serial 8
 
-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
 dnl From Volker Borchert.
-dnl Determine whether rename works for source paths with a trailing slash.
+dnl Determine whether rename works for source file names with a trailing slash.
 dnl The rename from SunOS 4.1.1_U1 doesn't.
 dnl
 dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
@@ -41,8 +41,8 @@ AC_DEFUN([vb_FUNC_RENAME],
     AC_DEFINE(rename, rpl_rename,
       [Define to rpl_rename if the replacement function should be used.])
     AC_DEFINE(RENAME_TRAILING_SLASH_BUG, 1,
-      [Define if rename does not work for source paths with a trailing slash,
-       like the one from SunOS 4.1.1_U1.])
+      [Define if rename does not work for source file names with a trailing
+       slash, like the one from SunOS 4.1.1_U1.])
     gl_PREREQ_RENAME
   fi
 ])
index 42b50fcafe197a5ffe16b5256be1c764888339e4..be574faa377851f6104dfd9a62a68b72c809dca7 100644 (file)
@@ -8,7 +8,7 @@ m4/canonicalize.m4
 
 Depends-on:
 cycle-check
-path-concat
+filenamecat
 stat-macros
 xalloc
 xgetcwd
diff --git a/modules/filenamecat b/modules/filenamecat
new file mode 100644 (file)
index 0000000..fb1786b
--- /dev/null
@@ -0,0 +1,26 @@
+Description:
+Concatenate two arbitrary file names.
+
+Files:
+lib/filenamecat.h
+lib/filenamecat.c
+m4/dos.m4
+m4/filenamecat.m4
+
+Depends-on:
+xalloc
+dirname
+
+configure.ac:
+gl_FILE_NAME_CONCAT
+
+Makefile.am:
+
+Include:
+"filenamecat.h"
+
+License:
+GPL
+
+Maintainer:
+Jim Meyering
diff --git a/modules/makepath b/modules/makepath
deleted file mode 100644 (file)
index 5dc5bf7..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-Description:
-Ensure that a directory path exists.
-
-Files:
-lib/makepath.h
-lib/makepath.c
-m4/afs.m4
-m4/makepath.m4
-
-Depends-on:
-alloca
-chown
-gettext
-save-cwd
-dirname
-error
-quote
-stat-macros
-stdbool
-
-configure.ac:
-gl_MAKEPATH
-
-Makefile.am:
-
-Include:
-"makepath.h"
-
-License:
-GPL
-
-Maintainer:
-Jim Meyering
diff --git a/modules/mkdir-p b/modules/mkdir-p
new file mode 100644 (file)
index 0000000..b3f787b
--- /dev/null
@@ -0,0 +1,33 @@
+Description:
+Ensure that a directory and its parents exist.
+
+Files:
+lib/mkdir-p.h
+lib/mkdir-p.c
+m4/afs.m4
+m4/mkdir-p.m4
+
+Depends-on:
+alloca
+chown
+gettext
+save-cwd
+dirname
+error
+quote
+stat-macros
+stdbool
+
+configure.ac:
+gl_MKDIR_PARENTS
+
+Makefile.am:
+
+Include:
+"mkdir-p.h"
+
+License:
+GPL
+
+Maintainer:
+Jim Meyering
diff --git a/modules/path-concat b/modules/path-concat
deleted file mode 100644 (file)
index e108c55..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Description:
-Construct a full pathname by concatenating a directory name and a relative
-filename.
-
-Files:
-lib/path-concat.h
-lib/path-concat.c
-m4/dos.m4
-m4/path-concat.m4
-
-Depends-on:
-xalloc
-dirname
-
-configure.ac:
-gl_PATH_CONCAT
-
-Makefile.am:
-
-Include:
-"path-concat.h"
-
-License:
-GPL
-
-Maintainer:
-Jim Meyering