Re: [PATCH] Have tests and programs understand paths containing spaces

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

 



On Tue, Apr 22, 2008 at 11:28:01PM +0200, Arjen Laarhoven wrote:
> 
> diff --git a/builtin-tag.c b/builtin-tag.c
> index 129ff57..2d04d4f 100644
> --- a/builtin-tag.c
> +++ b/builtin-tag.c
> @@ -55,7 +55,7 @@ void launch_editor(const char *path, struct strbuf *buffer, const char *const *e
>  		strbuf_init(&arg0, 0);
>  		if (strcspn(editor, "$ \t'") != len) {
>  			/* there are specials */
> -			strbuf_addf(&arg0, "%s \"$@\"", editor);
> +			strbuf_addf(&arg0, "'%s' \"$@\"", editor);

This change has been already discussed on the mail, and I believe it
was ultimately rejected, because it will break things for people using
something like that: GIT_EDITOR='emacs -nw'. If you have spaces in the
path to your editor, you should quote in the definition of the editor:

git config core.editor '"c:/Program Files/What/Ever.exe"'

Thus, by putting extra quotes will break things for people who uses some
their favorite editor with extra options and for those who already use an
editor from c:/Program Files on Windows.

> diff --git a/git-send-email.perl b/git-send-email.perl
> index 9e568bf..40a521a 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -512,7 +512,7 @@ EOT
>  	close(C);
>  
>  	my $editor = $ENV{GIT_EDITOR} || Git::config(@repo, "core.editor") || $ENV{VISUAL} || $ENV{EDITOR} || "vi";
> -	system('sh', '-c', '$0 $@', $editor, $compose_filename);
> +	system('sh', '-c', '"$0" $@', $editor, $compose_filename);

See above.

>  
>  	open(C2,">",$compose_filename . ".final")
>  		or die "Failed to open $compose_filename.final : " . $!;
> diff --git a/git-sh-setup.sh b/git-sh-setup.sh
> index a44b1c7..a8a024b 100755
> --- a/git-sh-setup.sh
> +++ b/git-sh-setup.sh
> @@ -73,7 +73,7 @@ git_editor() {
>  		exit 1
>  		;;
>  	esac
> -	eval "${GIT_EDITOR:=vi}" '"$@"'
> +	eval '"${GIT_EDITOR:=vi}"' '"$@"'

See above.


Dmitry
--
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]

  Powered by Linux