[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [checks/scripts] [PATCH 2/4] heredoc detection



On Tue, 2008-06-17 at 22:55 +0200, Frank Lichtenheld wrote:
> On Sat, Jun 14, 2008 at 10:47:31AM +0100, Adam D. Barratt wrote:
> > On Sat, 2008-06-14 at 05:05 +0200, Frank Lichtenheld wrote:
> > > On Fri, Jun 13, 2008 at 03:08:41PM +0100, Adam D. Barratt wrote:
> > > > @@ -615,6 +631,7 @@
> > > >  
> > > >  		# We've checked for all the things we still want to notice in
> > > >  		# double-quoted strings, so now remove those strings as well.
> > > > +		$cat_line =~ s/(^|[^<\\'\\-](?:\\\\)*)\"(?:\\.|[^\\\"])+\"/$1""/g;
> > > >  		unless ($found) {
> > > >  		    $line =~ s/(^|[^\\\'](?:\\\\)*)\"(?:\\.|[^\\\"])+\"/$1""/g;
> > > 
> > > [^<\\'\\-] should probably be [^<\\\'-]
> > 
> > Yep, thanks; fixed in checkbashisms as well (the earlier version
> > removing single quoted strings was correct).
> 
> Applied with the fix above and the replacement of the duplicated regexes
> by variables.

Thanks; fwiw, the regexes aren't (quite) duplicated.

The $cat_line substitution includes "<" and "-" in the set of characters
that are removed; the $line substitution doesn't (if they were the same
then $cat_line would be largely superfluous).

Adam


Reply to: