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

Re: [PATCH] fix for interactive merge-callback not supporting spaces in file paths

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2007-07-18 12:11:49 CEST

On 7/17/07, David Glasser <glasser@mit.edu> wrote:
> On 7/17/07, Erik Huelsmann <ehuels@gmail.com> wrote:
> > Isn't it an option to add additional quotes around the path argument, changing
> >
> > cmd = apr_psprintf(pool, "%s %s", editor, path);
> >
> > to
> >
> > cmd = apr_psprintf(pool, "%s \"%s\"", editor, path);
> >
> > ? The editor should already be appropriately quoted.
>
> I feel like this change would be just the first step down the
> rabbit-hole. Next we need to deal with the possibility of double
> quotes in the path, etc.

Well, I feel a little bit differently: I think we can refuse to handle
double quotes in paths. It's no where near a common case. OTOH, a path
with spaces is nearly *the* common case on Windows ("Documents and
Settings", "Program Files"?)

> It's a tricky little problem. Why don't we tokenize the editor
> argument with apr_tokenize_to_argv and then use something like
> apr_proc_create which takes an argv error instead? That's what
> libsvn_ra_svn does (see its client.c(find_tunnel_agent)).

Well, the editor is supposed to be a shell command, not an executable.
I have no idea if that makes any difference, but things as
"HOME=/home/erik vi" are acceptable input, meaning that you can't rely
on the first token to be the command to be executed...

bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jul 18 12:10:57 2007

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.