[GRASS-SVN] r30801 - grass/trunk/lib/imagery

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Mar 29 22:48:26 EDT 2008


Author: hamish
Date: 2008-03-29 22:48:26 -0400 (Sat, 29 Mar 2008)
New Revision: 30801

Modified:
   grass/trunk/lib/imagery/find.c
   grass/trunk/lib/imagery/fopen.c
   grass/trunk/lib/imagery/target.c
Log:
GNAME_MAX, i18n

Modified: grass/trunk/lib/imagery/find.c
===================================================================
--- grass/trunk/lib/imagery/find.c	2008-03-29 20:39:50 UTC (rev 30800)
+++ grass/trunk/lib/imagery/find.c	2008-03-30 02:48:26 UTC (rev 30801)
@@ -27,7 +27,7 @@
 
 int I_find_group_file(char *group, char *file)
 {
-    char element[100];
+    char element[GNAME_MAX];
 
     if (!I_find_group (group))
 	return 0;
@@ -35,14 +35,14 @@
 	return 0;
 
     sprintf (element, "group/%s", group);
-    G_debug(4,"I_find_group_file: element <%s>", element);
+    G_debug(4, "I_find_group_file: element <%s>", element);
 
     return G_find_file (element, file, G_mapset()) != NULL ;
 }
 
-int I_find_subgroup(char *group,char *subgroup)
+int I_find_subgroup(char *group, char *subgroup)
 {
-    char element[300];
+    char element[GNAME_MAX];
 
     if (!I_find_group(group))
 	return 0;
@@ -54,9 +54,9 @@
     return G_find_file (element, subgroup, G_mapset()) != NULL ;
 }
 
-int I_find_subgroup_file( char *group, char *subgroup, char *file)
+int I_find_subgroup_file(char *group, char *subgroup, char *file)
 {
-    char element[300];
+    char element[GNAME_MAX*2];
 
     if (!I_find_group(group))
 	return 0;

Modified: grass/trunk/lib/imagery/fopen.c
===================================================================
--- grass/trunk/lib/imagery/fopen.c	2008-03-29 20:39:50 UTC (rev 30800)
+++ grass/trunk/lib/imagery/fopen.c	2008-03-30 02:48:26 UTC (rev 30801)
@@ -1,6 +1,6 @@
 #include <stdio.h>
+#include <grass/gis.h>
 #include <grass/imagery.h>
-#include <grass/gis.h>
 #include <grass/glocale.h>
 
 
@@ -18,7 +18,7 @@
 I_fopen_group_file_new(char *group, char *file)
 {
     FILE *fd;
-    char element[100];
+    char element[GNAME_MAX];
 
     /* get group element name */
     sprintf (element, "group/%s", group);
@@ -36,7 +36,7 @@
 I_fopen_group_file_append (char *group, char *file)
 {
     FILE *fd;
-    char element[100];
+    char element[GNAME_MAX];
 
     /* get group element name */
     sprintf (element, "group/%s", group);
@@ -54,7 +54,7 @@
 I_fopen_group_file_old (char *group, char *file)
 {
     FILE *fd;
-    char element[100];
+    char element[GNAME_MAX];
 
     /* find file first */
     if (!I_find_group_file (group, file))
@@ -84,7 +84,7 @@
     char *file)
 {
     FILE *fd;
-    char element[300];
+    char element[GNAME_MAX*2];
 
     /* get subgroup element name */
     sprintf (element, "group/%s/subgroup/%s", group, subgroup);
@@ -105,7 +105,7 @@
     char *file)
 {
     FILE *fd;
-    char element[300];
+    char element[GNAME_MAX*2];
 
     /* get subgroup element name */
     sprintf (element, "group/%s/subgroup/%s", group, subgroup);
@@ -126,7 +126,7 @@
     char *file)
 {
     FILE *fd;
-    char element[300];
+    char element[GNAME_MAX*2];
 
     /* find file first */
     if (!I_find_subgroup_file (group, subgroup, file))

Modified: grass/trunk/lib/imagery/target.c
===================================================================
--- grass/trunk/lib/imagery/target.c	2008-03-29 20:39:50 UTC (rev 30800)
+++ grass/trunk/lib/imagery/target.c	2008-03-30 02:48:26 UTC (rev 30801)
@@ -1,8 +1,8 @@
 #include <stdio.h>
 #include <grass/gis.h>
 #include <grass/imagery.h>
+#include <grass/glocale.h>
 
-
 /*!
  * \brief read target information
  *
@@ -39,7 +39,7 @@
     if (!ok)
     {
 	*location = *mapset = 0;
-	G_warning ("unable to read target file for group [%s]", group);
+	G_warning (_("Unable to read target file for group [%s]"), group);
     }
 
     return ok;



More information about the grass-commit mailing list