[GRASS5] g.copy checking for mapset (from, to)

Hi all,

it seems that g.copy does not check if to_mapset exists... Attached
patch should fix it (I hope).

All suggestions welcomed...

Best regards, Martin

(attachments)

copy.c.diff.gz (802 Bytes)

it seems that g.copy does not check if to_mapset exists... Attached
patch should fix it (I hope).

I don't fully understand, do you mean to copy maps into another mapset
from the current one? That's not supported (or at least I don't think it
should be).

The "to" mapset is always the current one, and if that doesn't exist
you've got bigger problems.

?

+ G_message (_("<%s> not found\n"), from);

fyi- G_message(), G_warning(), and G_fatal_error() all supply a newline
already, only keep one in the string if you really want two of them in
the output.

Hamish

Hi Hamish,

2006/3/20, Hamish <hamish_nospam@yahoo.com>:

> it seems that g.copy does not check if to_mapset exists... Attached
> patch should fix it (I hope).

I don't fully understand, do you mean to copy maps into another mapset
from the current one? That's not supported (or at least I don't think it
should be).

The "to" mapset is always the current one, and if that doesn't exist
you've got bigger problems.

now I understand, I am only confused that I do not get any error
message when "to" is not valid map, e.g.

g.copy rast=dem_srtm@PERMANENT,dem@tempx

the current mapset is "temp", mapset "tempx" does not exist. I only
forgot that g.copy is able to copy a map only to the current mapset...

So sorry for disturbing you...

+ G_message (_("<%s> not found\n"), from);

fyi- G_message(), G_warning(), and G_fatal_error() all supply a newline
already, only keep one in the string if you really want two of them in
the output.

Thanks for note...

Martin