CVS update: /ccvs/lib/

[email protected] 10 Jun 2005 20:30:23 -0000
Newsgroups gmane.comp.version-control.cvs.cvs
Message-ID <[email protected]>
User: dprice  
Date: 05/06/10 13:30:23

Removed:
 /ccvs/lib/
  path-concat.c, path-concat.h, stat.c

Added:
 /ccvs/lib/
  filenamecat.c, filenamecat.h, lstat.h

Modified:
 /ccvs/lib/
  ChangeLog, Makefile.gnulib, Makefile.in, basename.c, canonicalize.c,
  canonicalize.h, dirname.c, dirname.h, fnmatch_.h, fnmatch_loop.c, getcwd.c,
  getlogin_r.c, lstat.c, mkstemp.c, openat.c, openat.h, pathmax.h, rename.c,
  stripslash.c, tempname.c, xreadlink.c

Log:
 Sync with GNULIB.
 * basename.c, canonicalize.c, canonicalize.h, dirname.c, dirname.h,
 fnmatch_.h, fnmatch_loop.c, getcwd.c, getlogin_r.c, mkstemp.c,
 openat.c, openat.h, pathmax.h, rename.c, stripslash.c, tempname.c,
 xreadlink.c: Update from GNULIB.
 * path-concat.c, path-concat.h: Rename to...
 * filenamecat.c, filenamecat.h: ...this.
 
 Test new stat module.
 * lstat.h: New file.
 * stat.c: Remove this file and...
 * lstat.c: ...move most functionality here.

File Changes:

Directory: /ccvs/lib/
=====================

File [changed]: ChangeLog
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/ChangeLog?r1=1.451&r2=1.452
Delta lines:  +15 -0
--------------------
--- ChangeLog	31 May 2005 04:13:19 -0000	1.451
+++ ChangeLog	10 Jun 2005 20:30:20 -0000	1.452
@@ -1,3 +1,18 @@
+2005-06-10  Derek Price  <[email protected]>
+
+	Sync with GNULIB.
+	* basename.c, canonicalize.c, canonicalize.h, dirname.c, dirname.h,
+	fnmatch_.h, fnmatch_loop.c, getcwd.c, getlogin_r.c, mkstemp.c,
+	openat.c, openat.h, pathmax.h, rename.c, stripslash.c, tempname.c,
+	xreadlink.c: Update from GNULIB.
+	* path-concat.c, path-concat.h: Rename to...
+	* filenamecat.c, filenamecat.h: ...this.
+
+	Test new stat module.
+	* lstat.h: New file.
+	* stat.c: Remove this file and...
+	* lstat.c: ...move most functionality here.
+
 2005-05-30  Conrad T. Pino  <[email protected]>
 
 	* libcvs.dsp: Add files "windows-NT/woe32.h" to project.

File [changed]: Makefile.gnulib
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/Makefile.gnulib?r1=1.56&r2=1.57
Delta lines:  +2 -2
-------------------
--- Makefile.gnulib	27 May 2005 18:06:18 -0000	1.56
+++ Makefile.gnulib	10 Jun 2005 20:30:20 -0000	1.57
@@ -8,8 +8,8 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Invoked as: gnulib-tool --import gettext vasnprintf regex atexit save-cwd dirname error exit exitfail extensions fnmatch-posix fnmatch mkstemp getopt stdbool getline getnline getndelim2 gethostname strcase getpass-gnu gettimeofday timespec gettime unlocked-io tzset restrict time_r mktime minmax memmove nanosleep stat lstat strerror vasprintf malloc realloc strftime xsize getpagesize md5 stdint yesno allocsa setenv getdate readlink xreadlink xgethostname mkdir rename dup2 strstr ftruncate strtoul pathmax xalloc-die pagealign_alloc closeout strdup canonicalize getlogin_r stat-macros quotearg
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --aux-dir=build-aux   alloca alloca-opt allocsa atexit canonicalize chdir-long closeout cycle-check dirname dup2 error exit exitfail extensions fnmatch fnmatch-posix fpending ftruncate getcwd getdate gethostname getline getlogin_r getndelim2 getnline getopt getpagesize getpass-gnu gettext gettime gettimeofday lstat malloc md5 memmove mempcpy memrchr minmax mkdir mkstemp mktime nanosleep openat pagealign_alloc path-concat pathmax quotearg readlink realloc regex rename restrict rpmatch save-cwd setenv stat stat-macros stdbool stdint strcase strdup strerror strftime strstr strtol strtoul time_r timespec tzset unistd-safer unlocked-io vasnprintf vasprintf xalloc xalloc-die xgetcwd xgethostname xreadlink xsize yesno
+# Invoked as: gnulib-tool --import gettext vasnprintf regex atexit save-cwd dirname error exit exitfail extensions fnmatch-posix fnmatch mkstemp getopt stdbool getline getnline getndelim2 gethostname strcase getpass-gnu gettimeofday timespec gettime unlocked-io tzset restrict time_r mktime minmax memmove nanosleep lstat strerror vasprintf malloc realloc strftime xsize getpagesize md5 stdint yesno allocsa setenv getdate readlink xreadlink xgethostname mkdir rename dup2 strstr ftruncate strtoul pathmax xalloc-die pagealign_alloc closeout strdup canonicalize getlogin_r stat-macros quotearg
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --aux-dir=build-aux   alloca alloca-opt allocsa atexit canonicalize chdir-long closeout cycle-check dirname dup2 error exit exitfail extensions filenamecat fnmatch fnmatch-posix fpending ftruncate getcwd getdate gethostname getline getlogin_r getndelim2 getnline getopt getpagesize getpass-gnu gettext gettime gettimeofday lstat malloc md5 memmove mempcpy memrchr minmax mkdir mkstemp mktime nanosleep openat pagealign_alloc pathmax quotearg readlink realloc regex rename restrict rpmatch save-cwd setenv stat-macros stdbool stdint strcase strdup strerror strftime strstr strtol strtoul time_r timespec tzset unistd-safer unlocked-io vasnprintf vasprintf xalloc xalloc-die xgetcwd xgethostname xreadlink xsize yesno
 
 AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies
 

File [changed]: Makefile.in
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/Makefile.in?r1=1.184&r2=1.185
Delta lines:  +21 -23
---------------------
--- Makefile.in	25 May 2005 15:54:00 -0000	1.184
+++ Makefile.in	10 Jun 2005 20:30:20 -0000	1.185
@@ -61,18 +61,18 @@
 	ChangeLog __fpending.c __fpending.h alloca.c asnprintf.c \
 	asprintf.c atexit.c canonicalize.c canonicalize.h chdir-long.c \
 	chdir-long.h closeout.c closeout.h dirname.c dirname.h \
-	dup-safer.c dup2.c exitfail.c exitfail.h fd-safer.c fncase.c \
-	fnmatch.c fseeko.c ftello.c ftruncate.c getcwd.c getcwd.h \
-	getdate.c getdate.h getdate.y gethostname.c getline.c \
-	getline.h getlogin_r.c getlogin_r.h getndelim2.c getopt.c \
-	getopt1.c getpagesize.h getpass.c getpass.h gettime.c \
-	gettimeofday.c glob.c lstat.c malloc.c md5.c md5.h memmove.c \
-	mempcpy.c mempcpy.h memrchr.c memrchr.h mkdir.c mkstemp.c \
-	mktime.c nanosleep.c openat.c openat.h pagealign_alloc.c \
-	pagealign_alloc.h path-concat.c path-concat.h pathmax.h \
+	dup-safer.c dup2.c exitfail.c exitfail.h fd-safer.c \
+	filenamecat.c filenamecat.h fncase.c fnmatch.c fseeko.c \
+	ftello.c ftruncate.c getcwd.c getcwd.h getdate.c getdate.h \
+	getdate.y gethostname.c getline.c getline.h getlogin_r.c \
+	getlogin_r.h getndelim2.c getopt.c getopt1.c getpagesize.h \
+	getpass.c getpass.h gettime.c gettimeofday.c glob.c lstat.c \
+	malloc.c md5.c md5.h memmove.c mempcpy.c mempcpy.h memrchr.c \
+	memrchr.h mkdir.c mkstemp.c mktime.c nanosleep.c openat.c \
+	openat.h pagealign_alloc.c pagealign_alloc.h pathmax.h \
 	printf-args.c printf-parse.c quotearg.c quotearg.h readlink.c \
 	realloc.c regex.c rename.c rpmatch.c save-cwd.c save-cwd.h \
-	setenv.c stat-macros.h stat.c strcasecmp.c strdup.c strdup.h \
+	setenv.c stat-macros.h strcasecmp.c strdup.c strdup.h \
 	strerror.c strftime.c strftime.h strncasecmp.c strstr.c \
 	strtol.c strtoul.c sunos57-select.c tempname.c time_r.c \
 	timespec.h unistd-safer.h unlocked-io.h unsetenv.c \
@@ -94,8 +94,8 @@
 	$(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \
 	$(top_srcdir)/m4/eoverflow.m4 $(top_srcdir)/m4/error.m4 \
 	$(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \
-	$(top_srcdir)/m4/fnmatch.m4 $(top_srcdir)/m4/fpending.m4 \
-	$(top_srcdir)/m4/ftruncate.m4 \
+	$(top_srcdir)/m4/filenamecat.m4 $(top_srcdir)/m4/fnmatch.m4 \
+	$(top_srcdir)/m4/fpending.m4 $(top_srcdir)/m4/ftruncate.m4 \
 	$(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
 	$(top_srcdir)/m4/getdate.m4 $(top_srcdir)/m4/gethostname.m4 \
 	$(top_srcdir)/m4/getline.m4 $(top_srcdir)/m4/getlogin_r.m4 \
@@ -117,15 +117,14 @@
 	$(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/nanosleep.m4 \
 	$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/onceonly_2_57.m4 \
 	$(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/pagealign_alloc.m4 \
-	$(top_srcdir)/m4/path-concat.m4 $(top_srcdir)/m4/pathmax.m4 \
-	$(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
-	$(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/readlink.m4 \
-	$(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/rename.m4 \
-	$(top_srcdir)/m4/restrict.m4 $(top_srcdir)/m4/rpmatch.m4 \
-	$(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/setenv.m4 \
-	$(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \
-	$(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/st_mtim.m4 \
-	$(top_srcdir)/m4/stat-macros.m4 $(top_srcdir)/m4/stat.m4 \
+	$(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/po.m4 \
+	$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/quotearg.m4 \
+	$(top_srcdir)/m4/readlink.m4 $(top_srcdir)/m4/regex.m4 \
+	$(top_srcdir)/m4/rename.m4 $(top_srcdir)/m4/restrict.m4 \
+	$(top_srcdir)/m4/rpmatch.m4 $(top_srcdir)/m4/save-cwd.m4 \
+	$(top_srcdir)/m4/setenv.m4 $(top_srcdir)/m4/signed.m4 \
+	$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/ssize_t.m4 \
+	$(top_srcdir)/m4/st_mtim.m4 $(top_srcdir)/m4/stat-macros.m4 \
 	$(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stdint.m4 \
 	$(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcase.m4 \
 	$(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
@@ -411,6 +410,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/dup2.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/exitfail.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fd-safer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/filenamecat.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fncase.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fnmatch.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/fseeko.Po@am__quote@
@@ -441,7 +441,6 @@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/nanosleep.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/openat.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pagealign_alloc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/path-concat.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/printf-args.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/printf-parse.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/quotearg.Po@am__quote@
@@ -452,7 +451,6 @@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/rpmatch.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/save-cwd.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/setenv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/stat.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strdup.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strerror.Po@am__quote@

File [changed]: basename.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/basename.c?r1=1.3&r2=1.4
Delta lines:  +2 -2
-------------------
--- basename.c	23 May 2005 17:44:30 -0000	1.3
+++ basename.c	10 Jun 2005 20:30:20 -0000	1.4
@@ -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

File [changed]: canonicalize.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/canonicalize.c?r1=1.1&r2=1.2
Delta lines:  +40 -38
---------------------
--- canonicalize.c	23 May 2005 22:56:57 -0000	1.1
+++ canonicalize.c	10 Jun 2005 20:30:20 -0000	1.2
@@ -48,7 +48,7 @@
 #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 @@
 
 #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 @@
 
   /* 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 @@
       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 @@
 #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 @@
 
   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 @@
       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 @@
 	  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 @@
 		    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 @@
 	      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 @@
 	    }
 	}
     }
-  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;
 }

File [changed]: canonicalize.h
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/canonicalize.h?r1=1.1&r2=1.2
Delta lines:  +3 -3
-------------------
--- canonicalize.h	23 May 2005 22:56:57 -0000	1.1
+++ canonicalize.h	10 Jun 2005 20:30:20 -0000	1.2
@@ -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
@@ -21,10 +21,10 @@
 
 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.  */

File [changed]: dirname.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/dirname.c?r1=1.3&r2=1.4
Delta lines:  +21 -21
---------------------
--- dirname.c	23 May 2005 17:44:30 -0000	1.3
+++ dirname.c	10 Jun 2005 20:30:20 -0000	1.4
@@ -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
@@ -26,40 +26,40 @@
 #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 @@
   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;
 }

File [changed]: dirname.h
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/dirname.h?r1=1.3&r2=1.4
Delta lines:  +7 -7
-------------------
--- dirname.h	23 May 2005 17:44:30 -0000	1.3
+++ dirname.h	10 Jun 2005 20:30:20 -0000	1.4
@@ -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
@@ -31,17 +31,17 @@
 # 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_ */

File [added]: filenamecat.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/filenamecat.c?rev=1.1&content-type=text/vnd.viewcvs-markup
Added lines: 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

File [added]: filenamecat.h
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/filenamecat.h?rev=1.1&content-type=text/vnd.viewcvs-markup
Added lines: 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);

File [changed]: fnmatch_.h
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/fnmatch_.h?r1=1.2&r2=1.3
Delta lines:  +3 -3
-------------------
--- fnmatch_.h	23 May 2005 17:44:30 -0000	1.2
+++ fnmatch_.h	10 Jun 2005 20:30:20 -0000	1.3
@@ -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 @@
 #  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);

File [changed]: fnmatch_loop.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/fnmatch_loop.c?r1=1.3&r2=1.4
Delta lines:  +2 -2
-------------------
--- fnmatch_loop.c	23 May 2005 17:44:30 -0000	1.3
+++ fnmatch_loop.c	10 Jun 2005 20:30:20 -0000	1.4
@@ -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)

File [changed]: getcwd.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/getcwd.c?r1=1.2&r2=1.3
Delta lines:  +30 -30
---------------------
--- getcwd.c	23 May 2005 17:44:30 -0000	1.2
+++ getcwd.c	10 Jun 2005 20:30:20 -0000	1.3
@@ -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
@@ -114,7 +114,7 @@
 # define __readdir readdir
 #endif
 
-/* 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 @@
   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 @@
      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 @@
 
   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 @@
 	}
       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 @@
 
 		  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 @@
       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 @@
       free (dotlist);
 #endif
     if (buf == NULL)
-      free (path);
+      free (dir);
     __set_errno (save);
   }
   return NULL;

File [changed]: getlogin_r.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/getlogin_r.c?r1=1.2&r2=1.3
Delta lines:  +8 -1
-------------------
--- getlogin_r.c	25 May 2005 19:52:12 -0000	1.2
+++ getlogin_r.c	10 Jun 2005 20:30:20 -0000	1.3
@@ -44,8 +44,15 @@
 
   errno = 0;
   n = getlogin ();
+
+  /* A system function like getlogin_r is never supposed to set errno
+     to zero, so make sure errno is nonzero here.  ENOENT is a
+     reasonable errno value if getlogin returns NULL.  */
+  if (!errno)
+    errno = ENOENT;
+
   if (!n)
-    return errno ? errno : ENOENT;
+    return errno;
   nlen = strlen (n);
   if (size <= nlen)
     return ERANGE;

File [changed]: lstat.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/lstat.c?r1=1.3&r2=1.4
Delta lines:  +58 -6
--------------------
--- lstat.c	23 May 2005 17:44:31 -0000	1.3
+++ lstat.c	10 Jun 2005 20:30:20 -0000	1.4
@@ -1,8 +1,6 @@
-/* Work around the bug in some systems whereby lstat succeeds when
-   given the zero-length file name argument.  The lstat from SunOS 4.1.4
-   has this bug.
+/* Work around a bug of lstat on some systems
 
-   Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free
+   Copyright (C) 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
@@ -19,5 +17,59 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#define LSTAT
-#include "stat.c"
+/* written by Jim Meyering */
+
+#include <config.h>
+
+/* The specification of these functions is in sys_stat.h.  But we cannot
+   include this include file here, because on some systems, a
+   "#define lstat lstat64" is being used, and sys_stat.h deletes this
+   definition.  */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "stat-macros.h"
+#include "xalloc.h"
+
+/* lstat works differently on Linux and Solaris systems.  POSIX (see
+   `pathname resolution' in the glossary) requires that programs like `ls'
+   take into consideration the fact that FILE has a trailing slash when
+   FILE is a symbolic link.  On Linux systems, the lstat function already
+   has the desired semantics (in treating `lstat("symlink/",sbuf)' just like
+   `lstat("symlink/.",sbuf)', but on Solaris it does not.
+
+   If FILE has a trailing slash and specifies a symbolic link,
+   then append a `.' to FILE and call lstat a second time.  */
+
+int
+rpl_lstat (const char *file, struct stat *sbuf)
+{
+  size_t len;
+  char *new_file;
+
+  int lstat_result = lstat (file, sbuf);
+
+  if (lstat_result != 0 || !S_ISLNK (sbuf->st_mode))
+    return lstat_result;
+
+  len = strlen (file);
+  if (len == 0 || file[len - 1] != '/')
+    return lstat_result;
+
+  /* FILE refers to a symbolic link and the name ends with a slash.
+     Append a `.' to FILE and repeat the lstat call.  */
+
+  /* Add one for the `.' we'll append, and one more for the trailing NUL.  */
+  new_file = xmalloc (len + 1 + 1);
+  memcpy (new_file, file, len);
+  new_file[len] = '.';
+  new_file[len + 1] = 0;
+
+  lstat_result = lstat (new_file, sbuf);
+  free (new_file);
+
+  return lstat_result;
+}

File [added]: lstat.h
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/lstat.h?rev=1.1&content-type=text/vnd.viewcvs-markup
Added lines: 24
---------------
/* Retrieving information about files.
   Copyright (C) 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.  */

#include <sys/stat.h>

#if !LSTAT_FOLLOWS_SLASHED_SYMLINK
extern int rpl_lstat (const char *name, struct stat *buf);
# undef lstat
# define lstat rpl_lstat
#endif

File [changed]: mkstemp.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/mkstemp.c?r1=1.3&r2=1.4
Delta lines:  +2 -2
-------------------
--- mkstemp.c	23 May 2005 17:44:31 -0000	1.3
+++ mkstemp.c	10 Jun 2005 20:30:20 -0000	1.4
@@ -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 @@
 
 /* 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)

File [changed]: openat.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/openat.c?r1=1.2&r2=1.3
Delta lines:  +9 -9
-------------------
--- openat.c	23 May 2005 17:44:31 -0000	1.2
+++ openat.c	10 Jun 2005 20:30:20 -0000	1.3
@@ -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 @@
       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 @@
       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 @@
    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 @@
 
   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 @@
     }
 
   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)

File [changed]: openat.h
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/openat.h?r1=1.2&r2=1.3
Delta lines:  +2 -2
-------------------
--- openat.h	23 May 2005 17:44:31 -0000	1.2
+++ openat.h	10 Jun 2005 20:30:20 -0000	1.3
@@ -36,11 +36,11 @@
 #  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

File [removed]: path-concat.c

File [removed]: path-concat.h

File [changed]: pathmax.h
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/pathmax.h?r1=1.2&r2=1.3
Delta lines:  +3 -8
-------------------
--- pathmax.h	23 May 2005 17:44:31 -0000	1.2
+++ pathmax.h	10 Jun 2005 20:30:20 -0000	1.3
@@ -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
@@ -22,15 +22,10 @@
 #  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
 
 # ifndef _POSIX_PATH_MAX
-#  define _POSIX_PATH_MAX 255
+#  define _POSIX_PATH_MAX 256
 # endif
 
 # if !defined PATH_MAX && defined _PC_PATH_MAX

File [changed]: rename.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/rename.c?r1=1.8&r2=1.9
Delta lines:  +11 -11
---------------------
--- rename.c	23 May 2005 17:44:32 -0000	1.8
+++ rename.c	10 Jun 2005 20:30:20 -0000	1.9
@@ -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
@@ -31,27 +31,27 @@
 #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;

File [removed]: stat.c

File [changed]: stripslash.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/stripslash.c?r1=1.5&r2=1.6
Delta lines:  +7 -6
-------------------
--- stripslash.c	23 May 2005 17:44:32 -0000	1.5
+++ stripslash.c	10 Jun 2005 20:30:20 -0000	1.6
@@ -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
@@ -21,17 +22,17 @@
 
 #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';

File [changed]: tempname.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/tempname.c?r1=1.4&r2=1.5
Delta lines:  +3 -3
-------------------
--- tempname.c	23 May 2005 17:44:33 -0000	1.4
+++ tempname.c	10 Jun 2005 20:30:20 -0000	1.5
@@ -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 @@
   return 0;
 }
 
-/* These are the characters used in temporary filenames.  */
+/* These are the characters used in temporary file names.  */
 static const char letters[] =
 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
 

File [changed]: xreadlink.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/lib/xreadlink.c?r1=1.2&r2=1.3
Delta lines:  +4 -4
-------------------
--- xreadlink.c	23 May 2005 17:44:33 -0000	1.2
+++ xreadlink.c	10 Jun 2005 20:30:20 -0000	1.3
@@ -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 @@
   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