On 11/8/05, Julian Foad <firstname.lastname@example.org> wrote:
> > email@example.com writes:
> >>------- Additional comments from firstname.lastname@example.org Mon Nov 7 09:59:04 -0800 2005 -------
> >>So, anyone know if there's a Cygwin (or APR) function for escaping a
> >>path so that it can be invoked as an executable reliably on Cygwin?
> >>Should we just put the executable path in single quotes or
> This is a cross-platform issue, not specific to CygWin.
> 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
> 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.
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.
For example, on Windows I did this test to see if I can make the editor start
in read-only mode:
set SVN_EDITOR="C:\Program Files\Posix Toolkit\bin\vi.exe" -R
On Linux the way you get quotes into the variable depends on your shell
escaping mechanisms or if your shell supports dual quote types. For example:
setenv SVN_EDITOR '"/home/mks/path space/bin/vi" -R'
Both worked exactly as I would expect and handled the space in the command
without changing SVN or removing the ability to provide command line options
to the editor.
Michael Sinz Technology and Engineering Director/Consultant
"Starting Startups" mailto:Michael.Sinz@sinz.org
My place on the web http://www.sinz.org/Michael.Sinz
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Tue Nov 8 14:53:45 2005