[Bf-committers] system() with spaces

Alexander Ewering blender at instinctive.de
Sat Nov 18 21:57:10 CET 2006


On Sat, 18 Nov 2006, [ISO-8859-1] Mathias Panzenböck wrote:

> This should work in most cases under linux, but what if there is a $ or " in 
> the filename?
> This is very unlikely, but possible.
>
> In python 2.5 I would write a escape function:
>
> def escape(s):
> 	return "'%s'" % ''.join(c if c != "'" else "'\\''" for c in s)
>
> But in C this is a lot harder.

Well, the problem would not be to write an escape function, the problem
is HOW to escape correctly. I could have sworn that command names (with
their paths) can be quoted on win32, as I've seen that in "Properties.."
dialogs from desktop links, for example.. but appearently, I'm wrong..

If nobody can say anything about this matter, I'll rollback the change...

| alexander ewering              instinctive mediaworks
| xx-mail.com/instinctive     http://www.instinctive.de


More information about the Bf-committers mailing list