about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-08-02 21:20:32 +0000
committerUlrich Drepper <drepper@redhat.com>2000-08-02 21:20:32 +0000
commitf6cfb13f55f00086f136ba653c77c01b58205322 (patch)
tree2d7f9b6d6033aa811e0ec2967fecefff945d2c4f
parentcfd57cdc0fa51670e7b00da02a22c95925b17dae (diff)
downloadglibc-f6cfb13f55f00086f136ba653c77c01b58205322.tar.gz
glibc-f6cfb13f55f00086f136ba653c77c01b58205322.tar.xz
glibc-f6cfb13f55f00086f136ba653c77c01b58205322.zip
Update.
	* posix/regex.c (compile_range): Transliate range start and end
	characters to avoid empty range in case of REG_ICASE [PR libc/1842].
-rw-r--r--ChangeLog3
-rw-r--r--manual/examples/popen.c11
-rw-r--r--posix/regex.c4
3 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index bd00b8475f..1e2d1ac126 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-08-02  Ulrich Drepper  <drepper@redhat.com>
 
+	* posix/regex.c (compile_range): Transliate range start and end
+	characters to avoid empty range in case of REG_ICASE [PR libc/1842].
+
 	* sysdeps/unix/sysv/linux/ia64/bits/resource.h: Don't include
 	asm/resource.h.
 
diff --git a/manual/examples/popen.c b/manual/examples/popen.c
index 16ae32fa16..1b9ee826b4 100644
--- a/manual/examples/popen.c
+++ b/manual/examples/popen.c
@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-void 
+void
 write_data (FILE * stream)
 {
   int i;
@@ -23,11 +23,16 @@ main (void)
   output = popen ("more", "w");
   if (!output)
     {
-      fprintf (stderr, "Could not run more.\n");
+      fprintf (stderr,
+	       "incorrect parameters or too many files.\n");
       return EXIT_FAILURE;
     }
   write_data (output);
-  pclose (output);
+  if (pclose (output) != 0)
+    {
+      fprintf (stderr,
+	       "Could not run more or other error.\n");
+    }
   return EXIT_SUCCESS;
 }
 /*@end group*/
diff --git a/posix/regex.c b/posix/regex.c
index 8c50446ba0..09d0a35e85 100644
--- a/posix/regex.c
+++ b/posix/regex.c
@@ -3518,9 +3518,9 @@ compile_range (range_start_char, p_ptr, pend, translate, syntax, b)
 
   /* Fetch the endpoints without translating them; the
      appropriate translation is done in the bit-setting loop below.  */
-  range_start[0] = range_start_char;
+  range_start[0] = TRANSLATE (range_start_char);
   range_start[1] = '\0';
-  range_end[0] = p[0];
+  range_end[0] = TRANSLATE (p[0]);
   range_end[1] = '\0';
 
   /* Have to increment the pointer into the pattern string, so the