Markus Neteler wrote:

> On Thu, Feb 14, 2013 at 2:55 PM, Helmut Kudrnovsky <[email protected]> wrote:
> >>Does this command work in G7 on the same data?
> >
> >
> > g.region -p rast3d=JR_7408MR_2m_t70@testvolume
> > WARNING: Rast3d_read_window: unable to find
> > [C:\grassdata/nc_spm_08/testvolume/windows3d/C:\grassdata/nc_spm_08/testvolume/grid3/JR_7408MR_2m_t70/cellhd].
> > ERROR: Nordwert muss größer als der Südwert sein
> >
> > not really...
> 
> I tried to debug this on Linux but I have no idea what to look for.
> The problem might be in
> 
> lib/raster3d/windowio.c
> Rast3d_getFullWindowPath()
> 
> Maybe this line causing troubles (guessing around)?
>     if ((*windowName == '/') || (*windowName == '.')) {

I think so.

> Glynn (sorry to ask you directly), any pointers for me?

The minimal portability fix for the above is:

        if (G_is_absolute_path(windowName) || (*windowName == '.'))

But I suggest either:

        if (strpbrk(windowName, "/\\")) {
or:
        if (strchr(windowName, GRASS_DIRSEP) || strchr(windowName, 
HOST_DIRSEP)) {

which will check whether the window "name" contains any slash or
backslash characters (in which case, it's almost certainly meant to be
a path rather than a name). Unlike the existing code, this will allow
relative paths which don't start with "./" (which should be
redundant). The second alternative avoids matching a backslash on Unix
(which probably doesn't matter; backslashes in filenames are legal but
rare).

Alternatively, assuming that window names are bound by the same rules
as raster map names:

        if (!G_legal_filename(windowName)) {

-- 
Glynn Clements <[email protected]>
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to