Previously the string constructed with
ld.launch_cmd = ld.VOGL_CMD_LINE + " " + ld.LD_PRELOAD + " " + ld.args.gameid;
was passed to system(). But ld.args.gameid can contain spaces. This adds quotes. Not sure if single quotes would be a good idea.
Previously you couldn't run a program with arguments. Example:
voglperfrun -- glxgears -info
would not work because -info was treated as an argument to voglperfrun. I'm not sure what I did was how it is intended, but at least it works.