[GRASS-SVN] r56591 - grass/trunk/imagery/i.pca
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jun 4 08:36:36 PDT 2013
Author: mmetz
Date: 2013-06-04 08:36:35 -0700 (Tue, 04 Jun 2013)
New Revision: 56591
Modified:
grass/trunk/imagery/i.pca/main.c
Log:
i.pca: fix #1991 and r56494
Modified: grass/trunk/imagery/i.pca/main.c
===================================================================
--- grass/trunk/imagery/i.pca/main.c 2013-06-04 09:38:47 UTC (rev 56590)
+++ grass/trunk/imagery/i.pca/main.c 2013-06-04 15:36:35 UTC (rev 56591)
@@ -130,14 +130,18 @@
/* input can be either several raster maps or a group */
if (bands > 1) {
+ char name[GNAME_MAX];
+
I_init_group_ref(&ref);
for (i = 0; opt_in->answers[i] != NULL; i++) {
- mapset = G_find_raster2(opt_in->answers[i], "");
+ /* strip @mapset, do not modify opt_in->answers */
+ strcpy(name, opt_in->answers[i]);
+ mapset = G_find_raster(name, "");
if (!mapset)
G_fatal_error(_("Raster map <%s> not found"),
opt_in->answers[i]);
/* Add input to group. */
- I_add_file_to_group_ref(opt_in->answers[i], mapset, &ref);
+ I_add_file_to_group_ref(name, mapset, &ref);
}
}
else {
@@ -185,7 +189,7 @@
for (i = 0; i < bands; i++) {
char tmpbuf[GNAME_MAX];
- sprintf(tmpbuf, "%s.%d", ref.file[i].name, i + 1);
+ sprintf(tmpbuf, "%s.%d", opt_out->answer, i + 1);
G_check_input_output_name(ref.file[i].name, tmpbuf, G_FATAL_EXIT);
inp_fd[i] = Rast_open_old(ref.file[i].name, ref.file[i].mapset);
More information about the grass-commit
mailing list