about summary refs log tree commit diff
path: root/string
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-07-22 16:54:32 +0000
committerUlrich Drepper <drepper@redhat.com>1998-07-22 16:54:32 +0000
commita7ab2023fcdd5c90c9f664cbaed8ef90dd38e818 (patch)
tree9b86dc161c5966099758510f55726e5f4a52af65 /string
parent61027f30c8f3ee9e280d2de3e240bf53864e0f61 (diff)
downloadglibc-a7ab2023fcdd5c90c9f664cbaed8ef90dd38e818.tar.gz
glibc-a7ab2023fcdd5c90c9f664cbaed8ef90dd38e818.tar.xz
glibc-a7ab2023fcdd5c90c9f664cbaed8ef90dd38e818.zip
Update.
1998-07-22  Ulrich Drepper  <drepper@cygnus.com>

	* Makefile (headers2_0): Add sigstack.h.

	* sysdeps/unix/sysv/linux/alpha/getrusage.S: Also define __getrusage.

1998-07-22 11:43  Ulrich Drepper  <drepper@cygnus.com>

	* libio/fileops.c (_IO_file_sync): Don't lock stream here.
	Reported by Thorsten Kukuk.

	* string/strcoll.c: Correct problem with empty strings.
	* string/strxfrm.c: Likewise.
	Reported by vbzoli@hbrt.hu [PR libc/719].

1998-07-21 18:40  Zack Weinberg  <zack@rabi.phys.columbia.edu>

	* sysdeps/posix/tempname.c: Use the random-name generator
	already used by mktemp/mkstemp.  Honor TMPDIR.

1998-07-21  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* hurd/Makefile (routines): Remove cthreads.
	* sysdeps/mach/hurd/Makefile (sysdep_routines): Add cthreads.

	* sysdeps/unix/sysv/linux/i386/Dist: Add missing files.

	* manual/Makefile (distribute): Add summary.texi.

1998-07-21 16:08  Zack Weinberg  <zack@rabi.phys.columbia.edu>
Diffstat (limited to 'string')
-rw-r--r--string/strcoll.c6
-rw-r--r--string/strxfrm.c10
2 files changed, 15 insertions, 1 deletions
diff --git a/string/strcoll.c b/string/strcoll.c
index cc39820fcf..8457ef8df1 100644
--- a/string/strcoll.c
+++ b/string/strcoll.c
@@ -82,6 +82,12 @@ STRCOLL (s1, s2, l)
   if (collate_nrules == 0)
     return STRCMP (s1, s2);
 
+  /* Handle empty strings as a special case.  */
+  if (*s1 == '\0')
+    return *s2 == '\0' ? 0 : -1;
+  else if (*s2 == '\0')
+    return 1;
+
   /* Get full information about the strings.  This means we get
      information for all passes in a special data structure.  */
   get_string (s1, s1forw, s1backw);
diff --git a/string/strxfrm.c b/string/strxfrm.c
index 8222adf435..795e8e4a73 100644
--- a/string/strxfrm.c
+++ b/string/strxfrm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
 
@@ -184,6 +184,14 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n, __locale_t l)
       return STRLEN (src);
     }
 
+  /* Handle an empty string as a special case.  */
+  if (*src == '\0')
+    {
+      if (n != 0)
+	*dest = '\0';
+      return 1;
+    }
+
   /* Get full information about the string.  This means we get
      information for all passes in a special data structure.  */
   get_string (src, forw, backw);