patches/glibc/2.1.3/rh62-08-glibc-2.1.3-glob.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Feb 24 11:00:05 2007 +0000 (2007-02-24)
changeset 1 eeea35fbf182
permissions -rw-r--r--
Add the full crosstool-NG sources to the new repository of its own.
You might just say: 'Yeah! crosstool-NG's got its own repo!".
Unfortunately, that's because the previous repo got damaged beyond repair and I had no backup.
That means I'm putting backups in place in the afternoon.
That also means we've lost history... :-(
     1 2001-11-29  Jakub Jelinek  <jakub@redhat.com>
     2 
     3 	* sysdeps/generic/glob.c (next_brace_sub): Return NULL if braces
     4 	don't match, fix {{a,b},c} globbing, clean up.
     5 	Patch by Flavio Veloso <flaviovs@magnux.com>.
     6 
     7 --- libc/sysdeps/generic/glob.c.jj	Thu Aug 23 18:49:29 2001
     8 +++ libc/sysdeps/generic/glob.c	Thu Nov 29 13:17:21 2001
     9 @@ -355,42 +355,14 @@ static
    10  inline
    11  #endif
    12  const char *
    13 -next_brace_sub (begin)
    14 -     const char *begin;
    15 +next_brace_sub (cp)
    16 +     const char *cp;
    17  {
    18    unsigned int depth = 0;
    19 -  const char *cp = begin;
    20 -
    21 -  while (1)
    22 -    {
    23 -      if (depth == 0)
    24 -	{
    25 -	  if (*cp != ',' && *cp != '}' && *cp != '\0')
    26 -	    {
    27 -	      if (*cp == '{')
    28 -		++depth;
    29 -	      ++cp;
    30 -	      continue;
    31 -	    }
    32 -	}
    33 -      else
    34 -	{
    35 -	  while (*cp != '\0' && (*cp != '}' || depth > 0))
    36 -	    {
    37 -	      if (*cp == '}')
    38 -		--depth;
    39 -	      ++cp;
    40 -	    }
    41 -	  if (*cp == '\0')
    42 -	    /* An incorrectly terminated brace expression.  */
    43 -	    return NULL;
    44 -
    45 -	  continue;
    46 -	}
    47 -      break;
    48 -    }
    49 -
    50 -  return cp;
    51 +  while (*cp != '\0' && (*cp != '}' || depth--) && (*cp != ',' || depth))
    52 +    if (*cp++ == '{')
    53 +      depth++;
    54 +  return *cp != '\0' ? cp : NULL;
    55  }
    56  
    57  #endif /* !GLOB_ONLY_P */