[Bf-committers] system() with spaces

Mathias Panzenböck grosser.meister.morti at gmx.net
Sat Nov 18 18:06:18 CET 2006


Alexander Ewering wrote:
> 
> After the commit, PLAY (and other places which call the Blender binary)
> still worked here on Linux. I just quoted the path (system("\"%s\" ...)
> instead of just system("%s ..."))

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.


	-panzi


More information about the Bf-committers mailing list