summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.cvsignore2
-rw-r--r--ChangeLog65
-rw-r--r--MakeTAGS2
-rw-r--r--Makeconfig4
-rw-r--r--Makerules6
-rw-r--r--conform/Makefile5
-rw-r--r--hesiod/nss_hesiod/hesiod-grp.c37
-rw-r--r--intl/bindtextdom.c6
-rw-r--r--intl/dcigettext.c328
-rw-r--r--intl/l10nflist.c10
-rw-r--r--intl/loadmsgcat.c19
-rw-r--r--intl/textdomain.c6
-rw-r--r--nis/nis_print_group_entry.c1
-rw-r--r--nscd/grpcache.c5
-rw-r--r--po/.cvsignore2
-rw-r--r--posix/glob/.cvsignore1
-rw-r--r--sysdeps/sparc/sparc64/elf/Dist4
-rw-r--r--sysdeps/sparc/sparc64/elf/Makefile10
-rw-r--r--sysdeps/sparc/sparc64/elf/crtbegin.S68
-rw-r--r--sysdeps/sparc/sparc64/elf/crtbeginS.S1
-rw-r--r--sysdeps/sparc/sparc64/elf/crtend.S69
-rw-r--r--sysdeps/sparc/sparc64/elf/crtendS.S1
-rw-r--r--sysdeps/unix/bsd/osf/.cvsignore1
23 files changed, 329 insertions, 324 deletions
diff --git a/.cvsignore b/.cvsignore
index 2f8a931382..e9b99fe5fb 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -19,8 +19,6 @@ analysis
 docs
 releases
 
-linuxthreads
-
 libc.prj .libc.prcs_aux
 libc.proj .snprj
 
diff --git a/ChangeLog b/ChangeLog
index 9bd6674f43..97c0d43985 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,68 @@
+2000-04-27  Ulrich Drepper  <drepper@redhat.com>
+
+	* hesiod/nss_hesiod/hesiod-grp.c (_nss_hesiod_initgroups): Handle
+	overflows in conversion from ASCII.
+
+2000-04-26  Jakub Jelinek  <jakub@redhat.com>
+
+	* Makeconfig (full_config_sysdirs): Renamed from full-config-sysdirs.
+	* Makerules (full_config_sysdirs): Likewise.
+	* MakeTAGS (full_config_sysdirs): Likewise.
+
+2000-04-26  Jakub Jelinek  <jakub@redhat.com>
+
+	* .cvsignore: Remove linuxthreads.
+	* po/.cvsignore: Remove *.pot.
+	* posix/glob/.cvsignore: Removed.
+	* sysdeps/unix/bsd/osf/.cvsignore: Removed.
+
+2000-04-25  Andreas Jaeger  <aj@suse.de>
+
+	* conform/Makefile (distribute): Also distribute contents of
+	subdirectories.
+
+	* Makerules (no_deps): Remove abi-versions.h.
+
+	* nis/nis_print_group_entry.c: Include alloca.h for alloca prototype.
+
+2000-04-25  Jakub Jelinek  <jakub@redhat.com>
+
+	* sysdeps/sparc/sparc64/elf/Dist: Remove.
+	* sysdeps/sparc/sparc64/elf/crtbegin.S: Remove.
+	* sysdeps/sparc/sparc64/elf/crtbeginS.S: Remove.
+	* sysdeps/sparc/sparc64/elf/crtend.S: Remove.
+	* sysdeps/sparc/sparc64/elf/crtendS.S: Remove.
+	* sysdeps/sparc/sparc64/elf/Makefile: Don't build crtbegin/crtend
+	objects.
+
+2000-04-25  Thorsten Kukuk  <kukuk@suse.de>
+
+	* nscd/grpcache.c: Fix gr_name pointer [PR/1702].
+
+2000-04-23  Bruno Haible  <clisp.cons.org>
+
+	* intl/dcigettext.c: Define _GNU_SOURCE as early as possible.
+	* intl/l10nflist.c: Likewise.
+
+2000-04-23  Bruno Haible  <clisp.cons.org>
+
+	* intl/bindtextdom.c [!_LIBC]: Define __libc_rwlock_define,
+	__libc_rwlock_wrlock, __libc_rwlock_unlock as empty.
+	* intl/textdomain.c [!_LIBC]: Likewise.
+	* intl/dcigettext.c [!_LIBC]: Define __libc_rwlock_define_initialized,
+	__libc_rwlock_rdlock, __libc_rwlock_unlock as empty.
+	* intl/loadmsgcat.c (_nl_load_domain) [!_LIBC, !HAVE_ICONV]: Avoid
+	syntax error.
+
+2000-04-23  Bruno Haible  <clisp.cons.org>
+
+	* intl/dcigettext.c (_nl_find_msg): Do the plural treatment and
+	character set conversion also in the case the translation was found
+	after a hash collision or through binary search. Store the maximum
+	index together with the converted message. Use iconv() when available.
+	In case of out of memory during conversion, return the unconverted
+	translated string, not NULL.
+
 2000-04-25  Jes Sorensen  <Jes.Sorensen@cern.ch>
 
 	* shlib-versions: Rename ia64 dynamic linker to ld-linux-ia64.so.1
diff --git a/MakeTAGS b/MakeTAGS
index f6546e8f3c..ac028d70c9 100644
--- a/MakeTAGS
+++ b/MakeTAGS
@@ -39,7 +39,7 @@ tags_sources = $(all-sources) $(all-headers) $(all-dist)
 endif	# ctype
 endif	# No tags_sources
 
-sysdep-dirs := $(full-config-sysdirs)
+sysdep-dirs := $(full_config_sysdirs)
 
 ifndef sysdep_dirs
 # Find all sysdep directories.
diff --git a/Makeconfig b/Makeconfig
index 8a7f94849b..c4f682968c 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -93,7 +93,7 @@ binfmt-subdir = aout
 endif
 
 # Complete path to sysdep dirs.
-export full-config-sysdirs := $(addprefix $(..),$(config-sysdirs))
+export full_config_sysdirs := $(addprefix $(..),$(config-sysdirs))
 
 # Run config.status to update config.make and config.h.  We don't show the
 # dependence of config.h to Make, because it is only touched when it
@@ -107,7 +107,7 @@ $(common-objpfx)config.make: $(common-objpfx)config.status \
 # Find all the sysdeps configure fragments, to make sure we re-run
 # configure when any of them changes.
 $(common-objpfx)config.status: $(..)version.h $(..)configure \
-			       $(foreach dir,$(full-config-sysdirs),\
+			       $(foreach dir,$(full_config_sysdirs),\
 					 $(wildcard \
 					   $(dir)/Implies) \
 					 $(patsubst %.in,%,\
diff --git a/Makerules b/Makerules
index 731ad0e873..baeb9b6ab0 100644
--- a/Makerules
+++ b/Makerules
@@ -58,13 +58,13 @@ include $(..)Makeconfig
 endif
 
 # `configure' writes a definition of `config-sysdirs' in `config.make'.
-sysdirs = $(strip $(full-config-sysdirs))
+sysdirs = $(strip $(full_config_sysdirs))
 
 +sysdir_pfx = $(common-objpfx)
 
 export sysdirs := $(sysdirs)
 
-+sysdep_dirs := $(full-config-sysdirs)
++sysdep_dirs := $(full_config_sysdirs)
 ifdef objdir
 +sysdep_dirs := $(objdir) $(+sysdep_dirs)
 endif
@@ -283,7 +283,7 @@ ifeq ($(versioning),yes)
 -include $(common-objpfx)sysd-versions
 $(addprefix $(common-objpfx),$(version-maps)): $(common-objpfx)sysd-versions
 common-generated += $(version-maps)
-postclean-generated += sysd-versions Versions.all
+postclean-generated += sysd-versions Versions.all abi-versions.h
 
 ifndef avoid-generated
 ifneq ($(sysd-versions-subdirs),$(all-subdirs) $(config-sysdirs))
diff --git a/conform/Makefile b/conform/Makefile
index bfa860b44f..af8f2a033a 100644
--- a/conform/Makefile
+++ b/conform/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1999 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000 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
@@ -21,4 +21,5 @@
 #
 subdir	:= conform
 
-distribute = conformtest.pl $(wildcard data/*.h-data)
+distribute = conformtest.pl $(wildcard data/*.h-data) \
+	   $(wildcard data/*/*.h-data)
diff --git a/hesiod/nss_hesiod/hesiod-grp.c b/hesiod/nss_hesiod/hesiod-grp.c
index c0b56ac214..a973fab80f 100644
--- a/hesiod/nss_hesiod/hesiod-grp.c
+++ b/hesiod/nss_hesiod/hesiod-grp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1997.
 
@@ -188,14 +188,19 @@ internal_gid_from_group (void *context, const char *groupname, gid_t *group)
 	{
 	  char *endp;
 	  char *q = ++p;
+	  long int val;
 
 	  q = p;
 	  while (*q != '\0' && *q != ':')
 	    ++q;
 
-	  *group = strtol (p, &endp, 10);
-	  if (endp == q && endp != p)
-	    status = NSS_STATUS_SUCCESS;
+	  val = strtol (p, &endp, 10);
+	  if (sizeof (gid_t) == sizeof (long int) || (gid_t) val == val)
+	    {
+	      *group = val;
+	      if (endp == q && endp != p)
+		status = NSS_STATUS_SUCCESS;
+	    }
         }
       hesiod_free_list (context, grp_res);
     }
@@ -219,7 +224,7 @@ _nss_hesiod_initgroups (const char *user, gid_t group, long int *start,
 
   if (list == NULL)
     {
-      hesiod_end(context);
+      hesiod_end (context);
       return errno == ENOENT ? NSS_STATUS_NOTFOUND : NSS_STATUS_UNAVAIL;
     }
 
@@ -231,6 +236,7 @@ _nss_hesiod_initgroups (const char *user, gid_t group, long int *start,
     {
       char *endp;
       char *q;
+      long int val;
 
       status = NSS_STATUS_NOTFOUND;
 
@@ -241,21 +247,24 @@ _nss_hesiod_initgroups (const char *user, gid_t group, long int *start,
       if (*q != '\0')
 	*q++ = '\0';
 
-      group = strtol (p, &endp, 10);
-      if (*endp == '\0' && endp != p)
-	status = NSS_STATUS_SUCCESS;
-      else
-	status = internal_gid_from_group (context, p, &group);
+      val = strtol (p, &endp, 10);
+      if (sizeof (gid_t) == sizeof (long int) || (gid_t) val == val)
+	{
+	  if (*endp == '\0' && endp != p)
+	    status = NSS_STATUS_SUCCESS;
+	  else
+	    status = internal_gid_from_group (context, p, &group);
 
-      if (status == NSS_STATUS_SUCCESS
-	  && !internal_gid_in_list (groups, group, *start))
-	groups[(*start)++] = group;
+	  if (status == NSS_STATUS_SUCCESS
+	      && !internal_gid_in_list (groups, group, *start))
+	    groups[(*start)++] = group;
+	}
 
       p = q;
     }
 
   hesiod_free_list (context, list);
-  hesiod_end(context);
+  hesiod_end (context);
 
   return NSS_STATUS_SUCCESS;
 }
diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c
index dde7eb131d..c5d4901a85 100644
--- a/intl/bindtextdom.c
+++ b/intl/bindtextdom.c
@@ -52,9 +52,9 @@ void free ();
 # include <bits/libc-lock.h>
 #else
 /* Provide dummy implementation if this is outside glibc.  */
-# define __libc_lock_define_initialized (CLASS, NAME)
-# define __libc_lock_lock(NAME)
-# define __libc_lock_unlock(NAME)
+# define __libc_rwlock_define(CLASS, NAME)
+# define __libc_rwlock_wrlock(NAME)
+# define __libc_rwlock_unlock(NAME)
 #endif
 
 /* @@ end of prolog @@ */
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index be312ce967..4f27cbb3d8 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -16,6 +16,13 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* Tell glibc's <string.h> to provide a prototype for mempcpy().
+   This must come before <config.h> because <config.h> may include
+   <features.h>, and once <features.h> has been included, it's too late.  */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE	1
+#endif
+
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -59,9 +66,6 @@ void free ();
 #endif
 
 #if defined HAVE_STRING_H || defined _LIBC
-# ifndef _GNU_SOURCE
-#  define _GNU_SOURCE	1
-# endif
 # include <string.h>
 #else
 # include <strings.h>
@@ -98,9 +102,12 @@ void free ();
 # include <bits/libc-lock.h>
 #else
 /* Provide dummy implementation if this is outside glibc.  */
-# define __libc_lock_define_initialized (CLASS, NAME)
+# define __libc_lock_define_initialized(CLASS, NAME)
 # define __libc_lock_lock(NAME)
 # define __libc_lock_unlock(NAME)
+# define __libc_rwlock_define_initialized(CLASS, NAME)
+# define __libc_rwlock_rdlock(NAME)
+# define __libc_rwlock_unlock(NAME)
 #endif
 
 /* @@ end of prolog @@ */
@@ -626,9 +633,9 @@ _nl_find_msg (domain_file, msgid, index)
      const char *msgid;
      unsigned long int index;
 {
-  size_t act = 0;
-  size_t top, bottom;
   struct loaded_domain *domain;
+  size_t act;
+  char *result;
 
   if (domain_file->decided == 0)
     _nl_load_domain (domain_file);
@@ -657,103 +664,8 @@ _nl_find_msg (domain_file, msgid, index)
 		     domain->data + W (domain->must_swap,
 				       domain->orig_tab[nstr - 1].offset)) == 0)
 	{
-	  /* We found an entry.  If we have to convert the string to use
-	     a different character set this is the time.  */
-	  char *result =
-	    (char *) domain->data + W (domain->must_swap,
-				       domain->trans_tab[nstr - 1].offset);
-
-	  /* Now skip some strings.  How much depends on the index passed
-	     in.  */
-	  while (index-- > 0)
-	    {
-#ifdef _LIBC
-	      result = __rawmemchr (result, '\0');
-#else
-	      result = strchr (result, '\0');
-#endif
-	      /* And skip over the NUL byte.  */
-	      ++result;
-	    }
-
-	  if (
-#ifdef _LIBC
-	      domain->conv != (__gconv_t) -1
-#else
-# if HAVE_ICONV
-	      domain->conv != (iconv_t) -1
-# endif
-#endif
-	      )
-	    {
-	      /* We are supposed to do a conversion.  First allocate an
-		 appropriate table with the same structure as the hash
-		 table in the file where we can put the pointers to the
-		 converted strings in.  */
-	      if (domain->conv_tab == NULL
-		  && ((domain->conv_tab = (char **) calloc (domain->hash_size,
-							    sizeof (char *)))
-		      == NULL))
-		/* Mark that we didn't succeed allocating a table.  */
-		domain->conv_tab = (char **) -1;
-
-	      if (domain->conv_tab == (char **) -1)
-		/* Nothing we can do, no more memory.  */
-		return NULL;
-
-	      if (domain->conv_tab[idx] == NULL)
-		{
-		  /* We haven't used this string so far, so it is not
-		     translated yet.  Do this now.  */
-#ifdef _LIBC
-		  /* For glibc we use a bit more efficient memory handling.
-		     We allocate always larger blocks which get used over
-		     time.  This is faster than many small allocations.   */
-		  __libc_lock_define_initialized (static, lock)
-		  static unsigned char *freemem;
-		  static size_t freemem_size;
-		  /* Note that we include the NUL byte.  */
-		  size_t resultlen = strlen (result) + 1;
-		  const unsigned char *inbuf = result;
-		  unsigned char *outbuf = freemem;
-		  size_t written;
-		  int res;
-
-		  __libc_lock_lock (lock);
-
-		  while ((res = __gconv (domain->conv,
-					 &inbuf, inbuf + resultlen,
-					 &outbuf, outbuf + freemem_size,
-					 &written)) == __GCONV_OK)
-		    {
-		      if (res != __GCONV_FULL_OUTPUT)
-			goto out;
-
-		      /* We must resize the buffer.  */
-		      freemem_size = MAX (2 * freemem_size, 4064);
-		      freemem = (char *) malloc (freemem_size);
-		      if (freemem == NULL)
-			goto out;
-
-		      inbuf = result;
-		      outbuf = freemem;
-		    }
-
-		  /* We have now in our buffer a converted string.  Put this
-		     in the hash table  */
-		  domain->conv_tab[idx] = freemem;
-		  freemem_size -= outbuf - freemem;
-		  freemem = outbuf;
-
-		out:
-		  __libc_lock_unlock (lock);
-#endif
-		}
-
-	      result = domain->conv_tab[idx];
-	    }
-
-	  return result;
+	  act = nstr - 1;
+	  goto found;
 	}
 
       while (1)
@@ -773,37 +685,199 @@ _nl_find_msg (domain_file, msgid, index)
 			  domain->data + W (domain->must_swap,
 					    domain->orig_tab[nstr - 1].offset))
 		  == 0))
-	    return ((char *) domain->data
-		    + W (domain->must_swap,
-			 domain->trans_tab[nstr - 1].offset));
+	    {
+	      act = nstr - 1;
+	      goto found;
+	    }
 	}
       /* NOTREACHED */
     }
+  else
+    {
+      /* Try the default method:  binary search in the sorted array of
+	 messages.  */
+      size_t top, bottom;
+
+      bottom = 0;
+      top = domain->nstrings;
+      while (bottom < top)
+	{
+	  int cmp_val;
+
+	  act = (bottom + top) / 2;
+	  cmp_val = strcmp (msgid, (domain->data
+				    + W (domain->must_swap,
+					 domain->orig_tab[act].offset)));
+	  if (cmp_val < 0)
+	    top = act;
+	  else if (cmp_val > 0)
+	    bottom = act + 1;
+	  else
+	    goto found;
+	}
+      /* No translation was found.  */
+      return NULL;
+    }
 
-  /* Now we try the default method:  binary search in the sorted
-     array of messages.  */
-  bottom = 0;
-  top = domain->nstrings;
-  while (bottom < top)
+ found:
+  /* The translation was found at index ACT.  If we have to convert the
+     string to use a different character set, this is the time.  */
+  result = (char *) domain->data
+	   + W (domain->must_swap, domain->trans_tab[act].offset);
+
+#if defined _LIBC || HAVE_ICONV
+  if (
+# ifdef _LIBC
+      domain->conv != (__gconv_t) -1
+# else
+#  if HAVE_ICONV
+      domain->conv != (iconv_t) -1
+#  endif
+# endif
+      )
     {
-      int cmp_val;
-
-      act = (bottom + top) / 2;
-      cmp_val = strcmp (msgid, (domain->data
-				+ W (domain->must_swap,
-				     domain->orig_tab[act].offset)));
-      if (cmp_val < 0)
-	top = act;
-      else if (cmp_val > 0)
-	bottom = act + 1;
-      else
-	break;
+      /* We are supposed to do a conversion.  First allocate an
+	 appropriate table with the same structure as the table
+	 of translations in the file, where we can put the pointers
+	 to the converted strings in.
+	 The is a slight complication with the INDEX: We don't know
+	 a priori which entries are plural entries. Therefore at any
+	 moment we can only translate the variants 0 .. INDEX.  */
+
+      if (domain->conv_tab == NULL
+	  && ((domain->conv_tab = (char **) calloc (domain->nstrings,
+						    sizeof (char *)))
+	      == NULL))
+	/* Mark that we didn't succeed allocating a table.  */
+	domain->conv_tab = (char **) -1;
+
+      if (domain->conv_tab == (char **) -1)
+	/* Nothing we can do, no more memory.  */
+	goto converted;
+
+      if (domain->conv_tab[act] == NULL
+	  || *(nls_uint32 *) domain->conv_tab[act] < index)
+	{
+	  /* We haven't used this string so far, so it is not
+	     translated yet.  Do this now.  */
+	  /* We use a bit more efficient memory handling.
+	     We allocate always larger blocks which get used over
+	     time.  This is faster than many small allocations.   */
+	  __libc_lock_define_initialized (static, lock)
+	  static unsigned char *freemem;
+	  static size_t freemem_size;
+
+	  size_t resultlen;
+	  const unsigned char *inbuf;
+	  unsigned char *outbuf;
+
+	  /* Note that we translate (index + 1) consecutive strings at
+	     once, including the final NUL byte.  */
+	  {
+	    unsigned long int i = index;
+	    char *p = result;
+	    do
+	      p += strlen (p) + 1;
+	    while (i-- > 0);
+	    resultlen = p - result;
+	  }
+
+	  inbuf = result;
+	  outbuf = freemem + 4;
+
+	  __libc_lock_lock (lock);
+
+# ifdef _LIBC
+	  {
+	    size_t written;
+	    int res;
+
+	    while ((res = __gconv (domain->conv,
+				   &inbuf, inbuf + resultlen,
+				   &outbuf, outbuf + freemem_size,
+				   &written)) == __GCONV_OK)
+	      {
+		if (res != __GCONV_FULL_OUTPUT)
+		  goto out;
+
+		/* We must resize the buffer.  */
+		freemem_size = MAX (2 * freemem_size, 4064);
+		freemem = (char *) malloc (freemem_size);
+		if (freemem == NULL)
+		  goto out;
+
+		inbuf = result;
+		outbuf = freemem + 4;
+	      }
+	  }
+# else
+#  if HAVE_ICONV
+	  for (;;)
+	    {
+	      const char *inptr = (const char *) inbuf;
+	      size_t inleft = resultlen;
+	      char *outptr = (char *) outbuf;
+	      size_t outleft = freemem_size;
+
+	      if (iconv (domain->conv, &inptr, &inleft, &outptr, &outleft)
+		  != (size_t)(-1))
+		{
+		  outbuf = (unsigned char *) outptr;
+		  break;
+		}
+	      if (errno != E2BIG)
+		goto out;
+
+	      /* We must resize the buffer.  */
+	      freemem_size = 2 * freemem_size;
+	      if (freemem_size < 4064)
+		freemem_size = 4064;
+	      freemem = (char *) malloc (freemem_size);
+	      if (freemem == NULL)
+		goto out;
+
+	      outbuf = freemem + 4;
+	    }
+#  endif
+# endif
+
+	  /* We have now in our buffer a converted string.  Put this
+	     into the table of conversions.  */
+	  *(nls_uint32 *) freemem = index;
+	  domain->conv_tab[act] = freemem;
+	  /* Shrink freemem, but keep it aligned.  */
+	  freemem_size -= outbuf - freemem;
+	  freemem = outbuf;
+	  freemem += freemem_size & 3;
+	  freemem_size = freemem_size & ~3;
+
+	out:
+	  __libc_lock_unlock (lock);
+	}
+
+      /* Now domain->conv_tab[act] contains the translation of at least
+	 the variants 0 .. INDEX.  */
+      result = domain->conv_tab[act] + 4;
+    }
+
+ converted:
+  /* The result string is converted.  */
+
+#endif /* _LIBC || HAVE_ICONV */
+
+  /* Now skip some strings.  How much depends on the index passed in.  */
+  while (index-- > 0)
+    {
+#ifdef _LIBC
+      result = __rawmemchr (result, '\0');
+#else
+      result = strchr (result, '\0');
+#endif
+      /* And skip over the NUL byte.  */
+      ++result;
     }
 
-  /* If an translation is found return this.  */
-  return bottom >= top ? NULL : ((char *) domain->data
-				 + W (domain->must_swap,
-				      domain->trans_tab[act].offset));
+  return result;
 }
 
 
diff --git a/intl/l10nflist.c b/intl/l10nflist.c
index ef599361a9..01e7e74956 100644
--- a/intl/l10nflist.c
+++ b/intl/l10nflist.c
@@ -16,15 +16,19 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+/* Tell glibc's <string.h> to provide a prototype for stpcpy().
+   This must come before <config.h> because <config.h> may include
+   <features.h>, and once <features.h> has been included, it's too late.  */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE	1
+#endif
+
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
 
 
 #if defined HAVE_STRING_H || defined _LIBC
-# ifndef _GNU_SOURCE
-#  define _GNU_SOURCE	1
-# endif
 # include <string.h>
 #else
 # include <strings.h>
diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
index a03fe0d809..75265c84a8 100644
--- a/intl/loadmsgcat.c
+++ b/intl/loadmsgcat.c
@@ -257,10 +257,12 @@ _nl_load_domain (domain_file)
   nullentry = _nl_find_msg (domain_file, "", 0);
   if (nullentry != NULL)
     {
-      const char *charsetstr = strstr (nullentry, "charset=");
+      const char *charsetstr;
       const char *plural;
       const char *nplurals;
 
+#if defined _LIBC || HAVE_ICONV
+      charsetstr = strstr (nullentry, "charset=");
       if (charsetstr != NULL)
 	{
 	  size_t len;
@@ -271,12 +273,12 @@ _nl_load_domain (domain_file)
 	  len = strcspn (charsetstr, " \t\n");
 
 	  charset = (char *) alloca (len + 1);
-#if defined _LIBC || HAVE_MEMPCPY
+# if defined _LIBC || HAVE_MEMPCPY
 	  *((char *) mempcpy (charset, charsetstr, len)) = '\0';
-#else
+# else
 	  memcpy (charset, charsetstr, len);
 	  charset[len] = '\0';
-#endif
+# endif
 
 	  /* The output charset should normally be determined by the
 	     locale.  But sometimes the locale is not used or not correctly
@@ -285,17 +287,18 @@ _nl_load_domain (domain_file)
 	  if (outcharset == NULL || outcharset[0] == '\0')
 	    outcharset = (*_nl_current[LC_CTYPE])->values[_NL_ITEM_INDEX (CODESET)].string;
 
-#ifdef _LIBC
+# ifdef _LIBC
 	  if (__gconv_open (outcharset, charset, &domain->conv,
 			    GCONV_AVOID_NOCONV)
 	      != __GCONV_OK)
 	    domain->conv = (__gconv_t) -1;
-#else
-# if HAVE_ICONV
+# else
+#  if HAVE_ICONV
 	  domain->conv = iconv_open (outcharset, charset);
+#  endif
 # endif
-#endif
 	}
+#endif /* _LIBC || HAVE_ICONV */
 
       /* Also look for a plural specification.  */
       plural = strstr (nullentry, "plural=");
diff --git a/intl/textdomain.c b/intl/textdomain.c
index 726b5bb8e3..2a4b67c564 100644
--- a/intl/textdomain.c
+++ b/intl/textdomain.c
@@ -46,9 +46,9 @@
 # include <bits/libc-lock.h>
 #else
 /* Provide dummy implementation if this is outside glibc.  */
-# define __libc_lock_define_initialized (CLASS, NAME)
-# define __libc_lock_lock(NAME)
-# define __libc_lock_unlock(NAME)
+# define __libc_rwlock_define(CLASS, NAME)
+# define __libc_rwlock_wrlock(NAME)
+# define __libc_rwlock_unlock(NAME)
 #endif
 
 /* @@ end of prolog @@ */
diff --git a/nis/nis_print_group_entry.c b/nis/nis_print_group_entry.c
index c5aa2abb88..7f50c85a8e 100644
--- a/nis/nis_print_group_entry.c
+++ b/nis/nis_print_group_entry.c
@@ -17,6 +17,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA. */
 
+#include <alloca.h>
 #include <string.h>
 #include <libintl.h>
 #include <rpcsvc/nis.h>
diff --git a/nscd/grpcache.c b/nscd/grpcache.c
index 7a591c81ae..983b297ad2 100644
--- a/nscd/grpcache.c
+++ b/nscd/grpcache.c
@@ -1,5 +1,5 @@
 /* Cache handling for group lookup.
-   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -158,7 +158,8 @@ cache_addgr (struct database *db, int fd, request_header *req, void *key,
 
       /* This is the member string length array.  */
       cp = mempcpy (cp, gr_mem_len, gr_mem_cnt * sizeof (size_t));
-      gr_name = cp = mempcpy (cp, grp->gr_name, gr_name_len);
+      gr_name = cp;
+      cp = mempcpy (cp, grp->gr_name, gr_name_len);
       cp = mempcpy (cp, grp->gr_passwd, gr_passwd_len);
 
       for (cnt = 0; cnt < gr_mem_cnt; ++cnt)
diff --git a/po/.cvsignore b/po/.cvsignore
index 6733a7efc3..db953980d5 100644
--- a/po/.cvsignore
+++ b/po/.cvsignore
@@ -1,2 +1,2 @@
-[a-z]*.pot *.mo
+*.mo
 ttt
diff --git a/posix/glob/.cvsignore b/posix/glob/.cvsignore
deleted file mode 100644
index 56631abf19..0000000000
--- a/posix/glob/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-ChangeLog
diff --git a/sysdeps/sparc/sparc64/elf/Dist b/sysdeps/sparc/sparc64/elf/Dist
deleted file mode 100644
index d9338c8fd6..0000000000
--- a/sysdeps/sparc/sparc64/elf/Dist
+++ /dev/null
@@ -1,4 +0,0 @@
-crtbegin.S
-crtbeginS.S
-crtend.S
-crtendS.S
diff --git a/sysdeps/sparc/sparc64/elf/Makefile b/sysdeps/sparc/sparc64/elf/Makefile
index 8da8a88c1b..a995e6cdf1 100644
--- a/sysdeps/sparc/sparc64/elf/Makefile
+++ b/sysdeps/sparc/sparc64/elf/Makefile
@@ -1,10 +1,4 @@
+# Sparc/ELF specific definitions.
+
 # The assembler on SPARC needs the -fPIC flag even when it's assembler code.
 ASFLAGS-.os = -fPIC
-
-ifeq ($(subdir), csu)
-extra-objs += crtbegin.o crtend.o crtbeginS.o crtendS.o
-install-lib += crtbegin.o crtend.o crtbeginS.o crtendS.o
-
-CPPFLAGS-crtbeginS.S = -fPIC -DPIC
-CPPFLAGS-crtendS.S = -fPIC -DPIC
-endif
diff --git a/sysdeps/sparc/sparc64/elf/crtbegin.S b/sysdeps/sparc/sparc64/elf/crtbegin.S
deleted file mode 100644
index c2fe01f6b0..0000000000
--- a/sysdeps/sparc/sparc64/elf/crtbegin.S
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Destructor cleanup code for elf64-sparc
-   Copyright (C) 1997 Free Software Foundation, Inc.
-   Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
- 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
- 
-   The GNU C Library 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
-   Library General Public License for more details.
- 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-
-.section ".ctors",#alloc,#write
-
-	.align 8
-__CTOR_LIST__:
-	.xword	-1
-
-.section ".dtors",#alloc,#write
-
-	.align 8
-__DTOR_LIST__:
-	.xword	-1
-
-.section ".fini",#alloc,#execinstr
-
-	call	__do_global_dtors_aux
-	 nop
-
-.text
-
-	.align 4
-	.type __do_global_dtors_aux,#function
-__do_global_dtors_aux:
-	save	%sp,-192,%sp
-
-#ifdef PIC
-1:	call	11f
-	sethi	%hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
-11:	or	%l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
-	add	%l7, %o7, %l7
-	sethi	%hi(__DTOR_LIST__), %l0
-	or	%l0, %lo(__DTOR_LIST__), %l0
-	ldx	[%l7+%l0], %l0
-#else
-	sethi	%hi(__DTOR_LIST__), %l0
-	or	%l0, %lo(__DTOR_LIST__), %l0
-#endif
-
-	ba	3f
-	 ldx	[%l0+8], %l1
-2:	jmpl	%l1, %o7
-	 ldx	[%l0+8], %l1
-3:	brnz,pt	%l1, 2b
-	 add	%l0, 8, %l0
-
-	ret
-	 restore
-
-	.size __do_global_dtors_aux,.-__do_global_dtors_aux
diff --git a/sysdeps/sparc/sparc64/elf/crtbeginS.S b/sysdeps/sparc/sparc64/elf/crtbeginS.S
deleted file mode 100644
index 7db4bc590e..0000000000
--- a/sysdeps/sparc/sparc64/elf/crtbeginS.S
+++ /dev/null
@@ -1 +0,0 @@
-#include "crtbegin.S"
diff --git a/sysdeps/sparc/sparc64/elf/crtend.S b/sysdeps/sparc/sparc64/elf/crtend.S
deleted file mode 100644
index db0ac87ecd..0000000000
--- a/sysdeps/sparc/sparc64/elf/crtend.S
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Constructor startup code for elf64-sparc
-   Copyright (C) 1997 Free Software Foundation, Inc.
-   Contributed by Richard Henderson <richard@gnu.ai.mit.edu>, 1997.
- 
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
- 
-   The GNU C Library 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
-   Library General Public License for more details.
- 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
- 
- 
-.section ".ctors",#alloc,#write
-
-	.align 8
-__CTOR_END__:
-	.xword	0
-
-.section ".dtors",#alloc,#write
-
-	.align 8
-__DTOR_END__:
-	.xword	0
-
-.section ".init",#alloc,#execinstr
-
-	call	__do_global_ctors_aux
-	 nop
-
-.text
-
-	.align 4
-	.type __do_global_ctors_aux,#function
-__do_global_ctors_aux:
-	save	%sp,-192,%sp
-
-#ifdef PIC
-1:	call	11f
-	sethi	%hi(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
-11:	or	%l7, %lo(_GLOBAL_OFFSET_TABLE_-(1b-.)), %l7
-	add	%l7, %o7, %l7
-	sethi	%hi(__CTOR_END__), %l0
-	or	%l0, %lo(__CTOR_END__), %l0
-	ldx	[%l7+%l0], %l0
-#else
-	sethi	%hi(__CTOR_END__), %l0
-	or	%l0, %lo(__CTOR_END__), %l0
-#endif
-
-	ba	3f
-	 ldx	[%l0+8], %l1
-2:	jmpl	%l1, %o7
-	 ldx	[%l0+8], %l1
-3:	addcc	%l1, 1, %g0
-	bnz,pt	%xcc, 2b
-	 add	%l0, 8, %l0
-
-	ret
-	 restore
-
-	.size __do_global_ctors_aux,.-__do_global_ctors_aux
diff --git a/sysdeps/sparc/sparc64/elf/crtendS.S b/sysdeps/sparc/sparc64/elf/crtendS.S
deleted file mode 100644
index 56532f567d..0000000000
--- a/sysdeps/sparc/sparc64/elf/crtendS.S
+++ /dev/null
@@ -1 +0,0 @@
-#include "crtend.S"
diff --git a/sysdeps/unix/bsd/osf/.cvsignore b/sysdeps/unix/bsd/osf/.cvsignore
deleted file mode 100644
index c9147fd335..0000000000
--- a/sysdeps/unix/bsd/osf/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-=*