X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fglob.c;h=a0af922d3ffa2d9cfb6a5ebf0bf9edf643837f09;hb=ccd54782ae73477aa3f3987ab04db9e6fde025d6;hp=a2b0d89f2d1c9b47fdc1cf955409f41cae60af2f;hpb=efc5123c9d851509aea5dd30f47c91e7e5a5c8dd;p=gnulib.git diff --git a/lib/glob.c b/lib/glob.c index a2b0d89f2..a0af922d3 100644 --- a/lib/glob.c +++ b/lib/glob.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2002,2003,2004,2005,2006 Free Software Foundation, Inc. +/* Copyright (C) 1991-2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,7 +16,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifdef HAVE_CONFIG_H +#ifndef _LIBC # include #endif @@ -93,7 +93,7 @@ # endif # define CONVERT_DIRENT_DIRENT64(d64, d32) \ - memcpy ((d64)->d_name, (d32)->d_name, NAMLEN (d32) + 1); \ + memcpy ((d64)->d_name, (d32)->d_name, _D_EXACT_NAMLEN (d32) + 1); \ CONVERT_D_INO (d64, d32) \ CONVERT_D_TYPE (d64, d32) #endif @@ -132,10 +132,6 @@ # endif # define struct_stat64 struct stat64 #else /* !_LIBC */ -# include "getlogin_r.h" -# include "mempcpy.h" -# include "stat-macros.h" -# include "strdup.h" # define __stat64(fname, buf) stat (fname, buf) # define struct_stat64 struct stat # define __stat(fname, buf) stat (fname, buf) @@ -163,6 +159,11 @@ static const char *next_brace_sub (const char *begin, int flags) __THROW; #endif /* !defined _LIBC || !defined GLOB_ONLY_P */ +/* The results of opendir() in this file are not used with dirfd and fchdir, + therefore save some unnecessary work in fchdir.c. */ +#undef opendir +#undef closedir + static int glob_in_dir (const char *pattern, const char *directory, int flags, int (*errfunc) (const char *, int), glob_t *pglob); @@ -1176,7 +1177,7 @@ glob_in_dir (const char *pattern, const char *directory, int flags, struct globlink *new = __alloca (sizeof (struct globlink)); char *p; - len = NAMLEN (d); + len = _D_EXACT_NAMLEN (d); new->name = malloc (len + 1 + ((flags & GLOB_MARK) && isdir)); if (new->name == NULL)