Re: [PATCH] submodule: fix quoting in relative_path()

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

 



On Wed, Apr 24, 2013 at 09:21:38AM -0700, Junio C Hamano wrote:
> John Keeping <john@xxxxxxxxxxxxx> writes:
> 
> >> > Why not just replace the six-liner by this one-liner:
> >> >
> >> > 		target=${target#"$curdir"/}
> >> 
> >> Simple enough ;-)
> >
> > This seems to have arrived on next without this fix, so here's a patch
> > on top.
> >
> >  git-submodule.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/git-submodule.sh b/git-submodule.sh
> > index 0eee703..db9f260 100755
> > --- a/git-submodule.sh
> > +++ b/git-submodule.sh
> > @@ -127,7 +127,7 @@ relative_path ()
> >  	do
> >  		case "$target" in
> >  		"$curdir/"*)
> > -			target=${target#$curdir/}
> > +			target=${target#"$curdir"/}
> >  			break
> >  			;;
> >  		esac
> 
> J6t meant a patch to remove the entire case...esac and replace it
> with a single liner (target=${target#"$curdir"/}).

Ah, I missed the "six-liner" part.  But that doesn't work because we
break out of the do...while loop when "$target" starts with "$curdir/"
and replacing the case statement will remove that.
--
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]