[GRASS-user] Database driver problem

Glynn Clements glynn at gclements.plus.com
Mon Oct 5 19:37:20 EDT 2009


Markus Neteler wrote:

> >> Could the problem be that \ and / slashes are used?
> >
> > Quite possibly. Try this:
> >
> > --- lib/db/dbmi_base/dbmscap.c  (revision 39364)
> > +++ lib/db/dbmi_base/dbmscap.c  (working copy)
> > @@ -175,6 +175,7 @@
> >        dirpath = G_malloc(strlen("\"\\driver\\db\\\"")
> >                           + strlen(G_gisbase()) + strlen(ent->d_name) + 1);
> >        sprintf(dirpath, "\"%s\\driver\\db\\%s\"", G_gisbase(), ent->d_name);
> > +       G_convert_dirseps_to_host(dirpath);
> >  #else
> >        G_asprintf(&dirpath, "\"%s/driver/db/%s\"", G_gisbase(), ent->d_name);
> >  #endif
> 
> Is this a harmless change? then I would submit it... otherwise it
> will take years to figure this out unless someone actually compiles
> and *tests* on Windows...
> Submitting it would get it at least into the next test compilation.

I suggest committing it. As it stands, dirpath will contain a mix of
forward slashes and backslashes, which is the worst possible case
(there are two ways that it could break).

In the longer term, we should really try to get rid of forward slashes
on Windows altogether, rather than fixing the individual cases where
they don't work.

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


More information about the grass-user mailing list