psss / rpms / bash

Forked from rpms/bash 6 years ago
Clone
Roman Rakus dbeb5d3
			     BASH PATCH REPORT
Roman Rakus dbeb5d3
			     =================
Roman Rakus dbeb5d3
Roman Rakus dbeb5d3
Bash-Release:	4.0
Roman Rakus dbeb5d3
Patch-ID:	bash40-025
Roman Rakus dbeb5d3
Roman Rakus dbeb5d3
Bug-Reported-by:	Matt Zyzik <matt.zyzik@nyu.edu>
Roman Rakus dbeb5d3
Bug-Reference-ID:	<20090519011418.GA21431@ice.filescope.com>
Roman Rakus dbeb5d3
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2009-05/msg00044.html
Roman Rakus dbeb5d3
Roman Rakus dbeb5d3
Bug-Description:
Roman Rakus dbeb5d3
Roman Rakus dbeb5d3
bash40-024 introduced a regression for constructs like **/*.cs; that
Roman Rakus dbeb5d3
expansion would no longer include matching files in the current directory.
Roman Rakus dbeb5d3
This patch undoes portions of bash40-024 and fixes the original problem
Roman Rakus dbeb5d3
in a different way.
Roman Rakus dbeb5d3
Roman Rakus dbeb5d3
Patch:
Roman Rakus dbeb5d3
Roman Rakus dbeb5d3
*** ../bash-4.0-patched/lib/glob/glob.c	2009-05-22 12:32:26.000000000 -0400
Roman Rakus dbeb5d3
--- lib/glob/glob.c	2009-05-22 12:35:55.000000000 -0400
Roman Rakus dbeb5d3
***************
Roman Rakus dbeb5d3
*** 666,672 ****
Roman Rakus dbeb5d3
      }
Roman Rakus dbeb5d3
  
Roman Rakus dbeb5d3
!   /* compat: if GX_ALLDIRS, add the passed directory also, but don't add an
Roman Rakus dbeb5d3
!      empty directory name. */
Roman Rakus dbeb5d3
!   if (add_current && (flags & GX_NULLDIR) == 0)
Roman Rakus dbeb5d3
      {
Roman Rakus dbeb5d3
        sdlen = strlen (dir);
Roman Rakus dbeb5d3
--- 666,673 ----
Roman Rakus dbeb5d3
      }
Roman Rakus dbeb5d3
  
Roman Rakus dbeb5d3
!   /* compat: if GX_ADDCURDIR, add the passed directory also.  Add an empty
Roman Rakus dbeb5d3
!      directory name as a placeholder if GX_NULLDIR (in which case the passed
Roman Rakus dbeb5d3
!      directory name is "."). */
Roman Rakus dbeb5d3
!   if (add_current)
Roman Rakus dbeb5d3
      {
Roman Rakus dbeb5d3
        sdlen = strlen (dir);
Roman Rakus dbeb5d3
***************
Roman Rakus dbeb5d3
*** 680,684 ****
Roman Rakus dbeb5d3
  	  nextlink->next = lastlink;
Roman Rakus dbeb5d3
  	  lastlink = nextlink;
Roman Rakus dbeb5d3
! 	  bcopy (dir, nextname, sdlen + 1);
Roman Rakus dbeb5d3
  	  ++count;
Roman Rakus dbeb5d3
  	}
Roman Rakus dbeb5d3
--- 681,688 ----
Roman Rakus dbeb5d3
  	  nextlink->next = lastlink;
Roman Rakus dbeb5d3
  	  lastlink = nextlink;
Roman Rakus dbeb5d3
! 	  if (flags & GX_NULLDIR)
Roman Rakus dbeb5d3
! 	    nextname[0] = '\0';
Roman Rakus dbeb5d3
! 	  else
Roman Rakus dbeb5d3
! 	    bcopy (dir, nextname, sdlen + 1);
Roman Rakus dbeb5d3
  	  ++count;
Roman Rakus dbeb5d3
  	}
Roman Rakus dbeb5d3
***************
Roman Rakus dbeb5d3
*** 1008,1016 ****
Roman Rakus dbeb5d3
        /* Just return what glob_vector () returns appended to the
Roman Rakus dbeb5d3
  	 directory name. */
Roman Rakus dbeb5d3
        dflags = flags & ~GX_MARKDIRS;
Roman Rakus dbeb5d3
        if (directory_len == 0)
Roman Rakus dbeb5d3
  	dflags |= GX_NULLDIR;
Roman Rakus dbeb5d3
        if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
Roman Rakus dbeb5d3
! 	dflags |= GX_ALLDIRS|GX_ADDCURDIR;
Roman Rakus dbeb5d3
        temp_results = glob_vector (filename,
Roman Rakus dbeb5d3
  				  (directory_len == 0 ? "." : directory_name),
Roman Rakus dbeb5d3
--- 1012,1033 ----
Roman Rakus dbeb5d3
        /* Just return what glob_vector () returns appended to the
Roman Rakus dbeb5d3
  	 directory name. */
Roman Rakus dbeb5d3
+       /* If flags & GX_ALLDIRS, we're called recursively */
Roman Rakus dbeb5d3
        dflags = flags & ~GX_MARKDIRS;
Roman Rakus dbeb5d3
        if (directory_len == 0)
Roman Rakus dbeb5d3
  	dflags |= GX_NULLDIR;
Roman Rakus dbeb5d3
        if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0')
Roman Rakus dbeb5d3
! 	{
Roman Rakus dbeb5d3
! 	  dflags |= GX_ALLDIRS|GX_ADDCURDIR;
Roman Rakus dbeb5d3
! #if 0
Roman Rakus dbeb5d3
! 	  /* If we want all directories (dflags & GX_ALLDIRS) and we're not
Roman Rakus dbeb5d3
! 	     being called recursively as something like `echo **/*.o'
Roman Rakus dbeb5d3
! 	     ((flags & GX_ALLDIRS) == 0), we want to prevent glob_vector from
Roman Rakus dbeb5d3
! 	     adding a null directory name to the front of the temp_results
Roman Rakus dbeb5d3
! 	     array.  We turn off ADDCURDIR if not called recursively and
Roman Rakus dbeb5d3
! 	     dlen == 0 */
Roman Rakus dbeb5d3
! #endif
Roman Rakus dbeb5d3
! 	  if (directory_len == 0 && (flags & GX_ALLDIRS) == 0)
Roman Rakus dbeb5d3
! 	    dflags &= ~GX_ADDCURDIR;
Roman Rakus dbeb5d3
! 	}
Roman Rakus dbeb5d3
        temp_results = glob_vector (filename,
Roman Rakus dbeb5d3
  				  (directory_len == 0 ? "." : directory_name),
Roman Rakus dbeb5d3
*** ../bash-4.0/patchlevel.h	2009-01-04 14:32:40.000000000 -0500
Roman Rakus dbeb5d3
--- patchlevel.h	2009-02-22 16:11:31.000000000 -0500
Roman Rakus dbeb5d3
***************
Roman Rakus dbeb5d3
*** 26,30 ****
Roman Rakus dbeb5d3
     looks for to find the patch level (for the sccs version string). */
Roman Rakus dbeb5d3
  
Roman Rakus dbeb5d3
! #define PATCHLEVEL 24
Roman Rakus dbeb5d3
  
Roman Rakus dbeb5d3
  #endif /* _PATCHLEVEL_H_ */
Roman Rakus dbeb5d3
--- 26,30 ----
Roman Rakus dbeb5d3
     looks for to find the patch level (for the sccs version string). */
Roman Rakus dbeb5d3
  
Roman Rakus dbeb5d3
! #define PATCHLEVEL 25
Roman Rakus dbeb5d3
  
Roman Rakus dbeb5d3
  #endif /* _PATCHLEVEL_H_ */