[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [Issue 2434] Spaces in path to EDITOR cause trouble

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-11-08 16:29:43 CET

Michael Sinz wrote:
> On 11/8/05, Julian Foad <julianfoad@btopenworld.com> wrote:
>
>>The implementation uses "system()" which requires that the program name and
>>arguments are represented by a single string with spaces delimiting program
>>name and arguments. We should use svn_io_run_command which keeps the program
>>name and arguments separately intact.
>
> Please don't change this - there is a perfectly good way to address
> the spaces issue.
>
>
>>Philip Martin wrote:
>>
>>>There was a patch to do something like that in the past. The current
>>>code allows things like
>>>
>>>SVN_EDITOR="LD_LIBRARY_PATH=/some/lib /some/program"
>>>
>>>and the patch would have stopped that working.
>>
>>It also allows initial arguments to be specified, like SVN_EDITOR="/bin/editor
>>--option=x".
>>
>>I doubt it was intended to allow things like that; that looks like an
>>accidental artifact of the implementation. In the absence of any further
>>argument for keeping the current behaviour I recommend calling it a bug and
>>fixing it, i.e. treat the whole variable as the name of a program.
>
> No, that is needed - some editors on some platforms detach by default
> and you need
> to provide some options to the editor.

Strictly speaking, that ability to specify a multi-word command line is USEFUL,
but not NECESSARY. The same issue is present for invoking external "diff"
command, but we handle that a different way, requiring an intermediate program
or script if it needs to modify arguments or environment variables.

> All that you need to do is "quote" the program name part of the variable and it
> will work just as expected. I tried this on Windows and Linux and all is well.

Excellent. That may be the best solution for invoking an editor: leave the
code alone and document the feature. Does anybody see a problem with that?

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 8 16:31:02 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.