Re: [POC PATCH 5/5] completion: avoid compgen to fix expansion issues in __gitcomp_nl()

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

 



On Fri, Sep 28, 2012 at 05:08:52PM +0200, SZEDER Gábor wrote:

> On Fri, Sep 28, 2012 at 12:09:35PM +0200, SZEDER Gábor wrote:
> >  __gitcomp_nl ()
> >  {
> >  	local IFS=$'\n'
> > -	COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}"))
> > +	COMPREPLY=($(echo "$1" |sed -n "/^${3-$cur}/ {
> 
> $cur can be a path, so it can contain /, which then breaks this sed
> expression.  Here's a fixup:

Worse than that, can't $cur contain arbitrary regex characters that will
be interpreted by sed?

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]