[GRASS-dev] winGRASS: enabling non-english languages?

Glynn Clements glynn at gclements.plus.com
Wed Jan 13 19:22:43 EST 2010


Glynn Clements wrote:

> > > Even if we continue to use _spawn*, the quoting code can be taken from
> > > 7.0; see escaped() in lib/gis/spawn.c. The code is actually quite
> > > tricky, due to the bizarre quoting rules:
> > >
> > >        http://msdn.microsoft.com/en-us/library/17w5ykft.aspx
> > 
> > Would it be possible for you to suggest a patch?
> 
> I'll look into it.

Copying spawn.c from 7.0 seems to work fine. But it's a significant
change, so it should be tested as thoroughly as possible. Also, fixing
G_spawn() doesn't help with modules which use system() or popen(); I
quite recently replaced most of those in 7.0.

BTW: in looking for test cases, I noticed that neither "g.list -f" nor
"g.mlist -f" work on Windows. E.g.:

    sprintf(lister, "%s/etc/lister/%s", G_gisbase(),
	    list[n].element[0]);

    if (access(lister, 1) == 0) {	/* execute permission? */
	G_spawn(lister, lister, opt.mapset->answer, NULL);
	continue;
    }

Because the path lacks the .exe suffix, the access() call fails. 
G_spawn() itself doesn't need the .exe suffix, but it never gets that
far.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list