On Mon, 15 Jan 2007 14:44:46 +0100, Enrico Tröger enrico.troeger@uvena.de wrote:
On Mon, 15 Jan 2007 04:31:29 -0600, "Jeff Pohlmeyer" yetanothergeek@gmail.com wrote:
Hi,
Rob, thanks for reporting.
Attached is a possible fix, but maybe Enrico knows some better way.
I think that patch is no good, because it doesn't take into account all the other special characters that the shell might interpret.
Also I don't think (read: hope) that in the path of an opened file should be any quotes.
But maybe there is a glib function already made for this: g_shell_quote()
My first attempt was to just include the path into quotes like this: cmd = g_strconcat("cd "", path, ""\n", NULL); This should solve the problem at least for whitespaces in the path. But there might be also some special characters(like German umlauts) in the path. I will also have a look at g_shell_quote().
g_shell_quote() doesn't do really more than escaping the given string. Ok it also takes care of already existing quotes in the string, but as mentioned above this really should not happen. So I used my first idea and it should be fixed in SVN r1192. Btw I did some testing with German umlauts and it already works.
Regards, Enrico
-- Get my GPG key from http://www.uvena.de/pub.key