about summary refs log tree commit diff
path: root/intl/l10nflist.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-06-03 22:46:17 +0000
committerRoland McGrath <roland@gnu.org>1996-06-03 22:46:17 +0000
commit5f2eab4263a916625b42d6ad6990ca0f658bca88 (patch)
treefeab32882be0f3d49089a3f4d203aeb37a072e22 /intl/l10nflist.c
parent20328c396217915d148013fd8f119aeb9ed2da0c (diff)
downloadglibc-5f2eab4263a916625b42d6ad6990ca0f658bca88.tar.gz
glibc-5f2eab4263a916625b42d6ad6990ca0f658bca88.tar.xz
glibc-5f2eab4263a916625b42d6ad6990ca0f658bca88.zip
Mon Jun 3 21:03:54 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
	* malloc/mcheck.c (freehook, reallochook): Handle null pointer args.

	* hurd/hurdsig.c (_hurd_internal_post_signal): When setting ACT to
	`ignore, resume the thread if SS_SUSPENDED, regardless of old action.

Sun Jun  2 20:14:30 1996  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* locale/programs/linereader.c (lr_open): Don't pass NULL to
	xstrdup; fix memory leak.
	(lr_close): Fix memory leak.

	* hurd/hurdsig.c (_hurd_internal_post_signal): When turning the action
Mon Jun  3 01:29:53 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* elf/link.h (struct link_map): Replace l_deps_loaded flag member with
	`struct link_map **l_searchlist'.
	* elf/dl-lookup.c (_dl_lookup_symbol): Make SYMBOL_SCOPE arg an array
	of two link_map ptrs.  Search the maps in the l_searchlist of each
	of the two elts that is non-null.
	* elf/dl-reloc.c (_dl_relocate_object): Pass proper SCOPE array.
	* elf/dl-runtime.c: Likewise.
	* elf/dlsym.c: Likewise.
	* elf/rtld.c (dl_main): Likewise.
Diffstat (limited to 'intl/l10nflist.c')
-rw-r--r--intl/l10nflist.c79
1 files changed, 74 insertions, 5 deletions
diff --git a/intl/l10nflist.c b/intl/l10nflist.c
index b0fdf51d73..00e3c8950a 100644
--- a/intl/l10nflist.c
+++ b/intl/l10nflist.c
@@ -1,7 +1,9 @@
 /* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
 Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
 
+This file is part of the GNU C Library.  Its master source is NOT part of
+the C library, however.  The master source lives in /gd/gnu/lib.
+
 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
@@ -14,16 +16,83 @@ 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.  */
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
 
-#include <argz.h>
+#if defined _LIBC && (defined __ARGZ_COUNT || defined __ARGZ_STRINGIFY)
+# include <argz.h>
+#endif
 #include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "loadinfo.h"
 
+/* Define function which are usually not available.  */
+
+#if !defined _LIBC && !defined __ARGZ_COUNT
+/* Returns the number of strings in ARGZ.  */
+static size_t __argz_count __P ((const char *argz, size_t len));
+
+static size_t
+__argz_count (argz, len)
+     const char *argz;
+     size_t len;
+{
+  size_t count = 0;
+  while (len > 0)
+    {
+      size_t part_len = strlen(argz);
+      argz += part_len + 1;
+      len -= part_len + 1;
+      count++;
+    }
+  return count;
+}
+#endif	/* !_LIBC && !__ARGZ_COUNT */
+
+#if !defined _LIBC && !defined __ARGZ_STRINGIFY
+/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
+   except the last into the character SEP.  */
+static void __argz_stringify __P ((char *argz, size_t len, int sep));
+
+static void
+__argz_stringify (argz, len, sep)
+     char *argz;
+     size_t len;
+     int sep;
+{
+  while (len > 0)
+    {
+      size_t part_len = strlen(argz);
+      argz += part_len;
+      len -= part_len + 1;
+      if (len > 0)
+	*argz++ = sep;
+    }
+}
+#endif	/* !_LIBC && !__ARGZ_COUNT */
+
+#if !defined _LIBC && !defined __ARGZ_NEXT
+static char *
+__argz_next (char *argz, size_t argz_len, const char *entry)
+{
+  if (entry)
+    {
+      if (entry < argz + argz_len)
+        entry = strchr (entry, '\0') + 1;
+
+      return entry >= argz + argz_len ? NULL : (char *) entry;
+    }
+  else
+    if (argz_len > 0)
+      return argz;
+    else
+      return 0;
+}
+#endif
+
+
 /* Return number of bits set in X.  */
 static int pop __P ((int x));
 
@@ -40,7 +109,7 @@ pop (x)
   return x;
 }
 
-
+
 struct loaded_l10nfile *
 _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
 		    territory, codeset, normalized_codeset, modifier, special,