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

Markus Neteler neteler at osgeo.org
Wed Jan 13 19:54:58 EST 2010


On Thu, Jan 14, 2010 at 1:22 AM, Glynn Clements
<glynn at gclements.plus.com> wrote:
> 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.

So far I am not able to compile winGRASS myself, but I am ready to test
if someone can compile it with spawn.c copied from G7 to 6.4.

> 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.

Would this be hell?

#ifndef __MINGW32__
    sprintf(lister, "%s/etc/lister/%s", G_gisbase(),
#else
    sprintf(lister, "%s/etc/lister.exe/%s", G_gisbase(),
#endif
           list[n].element[0]);


Typical MN approach :)

?
Markus


More information about the grass-dev mailing list