[ #4786 ] if space in the Application path name, system() doesn't work on some platforms
[blender.git] / source / blender / python / api2_2x / sceneRender.c
index 0016f983189595771411306372cad38bd9d25b16..3986df44e523a7ca8bd44c3e6d0cb04afdf0d719 100644 (file)
@@ -508,8 +508,13 @@ PyObject *RenderData_Play( BPy_RenderData * self )
                BKE_makepicstring( file, G.scene->r.pic, self->renderContext->sfra, G.scene->r.imtype);
                if( BLI_exist( file ) ) {
                        calc_renderwin_rectangle(640, 480, G.winpos, pos, size);
                BKE_makepicstring( file, G.scene->r.pic, self->renderContext->sfra, G.scene->r.imtype);
                if( BLI_exist( file ) ) {
                        calc_renderwin_rectangle(640, 480, G.winpos, pos, size);
+#ifdef WIN32
                        sprintf( str, "%s -a -p %d %d \"%s\"", bprogname,
                                 pos[0], pos[1], file );
                        sprintf( str, "%s -a -p %d %d \"%s\"", bprogname,
                                 pos[0], pos[1], file );
+#else
+                       sprintf( str, "\"%s\" -a -p %d %d \"%s\"", bprogname,
+                                pos[0], pos[1], file );
+#endif
                        system( str );
                } else
                        sprintf( "Can't find image: %s", file );
                        system( str );
                } else
                        sprintf( "Can't find image: %s", file );