[GRASS-SVN] r31773 - grass/branches/develbranch_6/imagery/i.group

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jun 21 04:31:37 EDT 2008


Author: neteler
Date: 2008-06-21 04:31:37 -0400 (Sat, 21 Jun 2008)
New Revision: 31773

Modified:
   grass/branches/develbranch_6/imagery/i.group/main.c
Log:
buffer length fixes; debug output added (merge from trunk)

Modified: grass/branches/develbranch_6/imagery/i.group/main.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.group/main.c	2008-06-21 08:31:27 UTC (rev 31772)
+++ grass/branches/develbranch_6/imagery/i.group/main.c	2008-06-21 08:31:37 UTC (rev 31773)
@@ -262,12 +262,13 @@
     struct Ref ref_tmp;
     char *mapset;
     char tmp_name[INAME_LEN];
-    char xname[512], xmapset[512];
+    char xname[GNAME_MAX], xmapset[GMAPSET_MAX];
 
     I_get_group_ref(group, &ref_tmp);
     I_init_group_ref(&ref);
 
  
+    G_debug(3, "remove_group_files: ref_tmp.nfiles %d", ref_tmp.nfiles);
     /* Go through existing files to check for duplicates */
     for (m = 0; m < ref_tmp.nfiles; m++) {
 	skip = 0;
@@ -282,6 +283,7 @@
 		strcpy(mapset, xmapset);
 	    }
 
+	    G_debug(3, "tmp_name %s, ref_tmp.file[%d].name: %s", tmp_name, m, ref_tmp.file[m].name);
 	    if ((strcmp(tmp_name, ref_tmp.file[m].name) == 0) &&
 		(strcmp(mapset, ref_tmp.file[m].mapset) == 0)) {
 		G_message(_("Removing raster map <%s> from group"),
@@ -316,11 +318,12 @@
     struct Ref ref_tmp;
     char *mapset;
     char tmp_name[INAME_LEN];
-    char xname[512], xmapset[512];
+    char xname[GNAME_MAX], xmapset[GMAPSET_MAX];
 
     I_get_subgroup_ref(group, subgroup, &ref_tmp);
     I_init_group_ref(&ref);
 
+    G_debug(3, "remove_subgroup_files: ref_tmp.nfiles %d", ref_tmp.nfiles);
     /* Go through existing files to check for duplicates */
     for (m = 0; m < ref_tmp.nfiles; m++) {
 	skip = 0;
@@ -335,6 +338,8 @@
 		strcpy(mapset, xmapset);
 	    }
 
+	    G_debug(3, "tmp_name %s, ref_tmp.file[%d].name: %s", tmp_name, m, ref_tmp.file[m].name);
+	    G_debug(3, "mapset %s, ref_tmp.file[%d].mapset: %s", mapset, m, ref_tmp.file[m].mapset);
 	    if ((strcmp(tmp_name, ref_tmp.file[m].name) == 0) &&
 		(strcmp(mapset, ref_tmp.file[m].mapset) == 0)) {
 		G_message(_("Removing raster map <%s> from subgroup"),



More information about the grass-commit mailing list