Re: g_spawn_win32_helper quoting



On Wed, Aug 27, 2003 at 09:17:47AM +0200, Thorsten Maerz wrote:
      cmd = "c:\\vim\\gvim.exe \"file with spc\" -c \":set ft=mail\"";
      child_argv = g_strsplit(cmd, " ", 1024);

You're splitting the command spaces here, which ignore your quotes.

Instead of thinking of this in terms of using the proper quotes, think
of it in terms of a calling a command with some arguments.
You are trying to call gvim.exe with three arguments.  Some of those
arugments happen to have spaces, but that doesn't matter as all
arguments are just strings anyway..

Try something this:
        char *child_argv[5];
        child_argv[0] = "c:\\vim\\gvim.exe";
        child_argv[1] = "file with spc";
        child_argv[2] = "-c";
        child_argv[3] = ":set ft=mail";
        child_argv[4] = NULL;

-- 
Evan Martin
martine danga com
http://neugierig.org



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]