patches/glibc/2.1.3/rh62-08-glibc-2.1.3-glob.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.1.3/rh62-08-glibc-2.1.3-glob.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,57 @@
     1.4 +2001-11-29  Jakub Jelinek  <jakub@redhat.com>
     1.5 +
     1.6 +	* sysdeps/generic/glob.c (next_brace_sub): Return NULL if braces
     1.7 +	don't match, fix {{a,b},c} globbing, clean up.
     1.8 +	Patch by Flavio Veloso <flaviovs@magnux.com>.
     1.9 +
    1.10 +--- libc/sysdeps/generic/glob.c.jj	Thu Aug 23 18:49:29 2001
    1.11 ++++ libc/sysdeps/generic/glob.c	Thu Nov 29 13:17:21 2001
    1.12 +@@ -355,42 +355,14 @@ static
    1.13 + inline
    1.14 + #endif
    1.15 + const char *
    1.16 +-next_brace_sub (begin)
    1.17 +-     const char *begin;
    1.18 ++next_brace_sub (cp)
    1.19 ++     const char *cp;
    1.20 + {
    1.21 +   unsigned int depth = 0;
    1.22 +-  const char *cp = begin;
    1.23 +-
    1.24 +-  while (1)
    1.25 +-    {
    1.26 +-      if (depth == 0)
    1.27 +-	{
    1.28 +-	  if (*cp != ',' && *cp != '}' && *cp != '\0')
    1.29 +-	    {
    1.30 +-	      if (*cp == '{')
    1.31 +-		++depth;
    1.32 +-	      ++cp;
    1.33 +-	      continue;
    1.34 +-	    }
    1.35 +-	}
    1.36 +-      else
    1.37 +-	{
    1.38 +-	  while (*cp != '\0' && (*cp != '}' || depth > 0))
    1.39 +-	    {
    1.40 +-	      if (*cp == '}')
    1.41 +-		--depth;
    1.42 +-	      ++cp;
    1.43 +-	    }
    1.44 +-	  if (*cp == '\0')
    1.45 +-	    /* An incorrectly terminated brace expression.  */
    1.46 +-	    return NULL;
    1.47 +-
    1.48 +-	  continue;
    1.49 +-	}
    1.50 +-      break;
    1.51 +-    }
    1.52 +-
    1.53 +-  return cp;
    1.54 ++  while (*cp != '\0' && (*cp != '}' || depth--) && (*cp != ',' || depth))
    1.55 ++    if (*cp++ == '{')
    1.56 ++      depth++;
    1.57 ++  return *cp != '\0' ? cp : NULL;
    1.58 + }
    1.59 + 
    1.60 + #endif /* !GLOB_ONLY_P */