mirror of
				https://sourceware.org/git/glibc.git
				synced 2025-11-03 20:53:13 +03:00 
			
		
		
		
	* posix/regex.c (compile_range): Transliate range start and end characters to avoid empty range in case of REG_ICASE [PR libc/1842].
		
			
				
	
	
		
			39 lines
		
	
	
		
			647 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			647 B
		
	
	
	
		
			C
		
	
	
	
	
	
#include <stdio.h>
 | 
						|
#include <stdlib.h>
 | 
						|
 | 
						|
void
 | 
						|
write_data (FILE * stream)
 | 
						|
{
 | 
						|
  int i;
 | 
						|
  for (i = 0; i < 100; i++)
 | 
						|
    fprintf (stream, "%d\n", i);
 | 
						|
  if (ferror (stream))
 | 
						|
    {
 | 
						|
      fprintf (stderr, "Output to stream failed.\n");
 | 
						|
      exit (EXIT_FAILURE);
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
/*@group*/
 | 
						|
int
 | 
						|
main (void)
 | 
						|
{
 | 
						|
  FILE *output;
 | 
						|
 | 
						|
  output = popen ("more", "w");
 | 
						|
  if (!output)
 | 
						|
    {
 | 
						|
      fprintf (stderr,
 | 
						|
	       "incorrect parameters or too many files.\n");
 | 
						|
      return EXIT_FAILURE;
 | 
						|
    }
 | 
						|
  write_data (output);
 | 
						|
  if (pclose (output) != 0)
 | 
						|
    {
 | 
						|
      fprintf (stderr,
 | 
						|
	       "Could not run more or other error.\n");
 | 
						|
    }
 | 
						|
  return EXIT_SUCCESS;
 | 
						|
}
 | 
						|
/*@end group*/
 |