[GRASS-SVN] r32455 - grass/branches/develbranch_6/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 2 06:45:37 EDT 2008


Author: martinl
Date: 2008-08-02 06:45:37 -0400 (Sat, 02 Aug 2008)
New Revision: 32455

Modified:
   grass/branches/develbranch_6/lib/gis/parser.c
Log:
parser.c: print 'option <%s>: <%s> exists' message in gui style if GRASS_MESSAGE_FORMAT=gui
(merge from trunk, r32453)


Modified: grass/branches/develbranch_6/lib/gis/parser.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/parser.c	2008-08-02 10:45:27 UTC (rev 32454)
+++ grass/branches/develbranch_6/lib/gis/parser.c	2008-08-02 10:45:37 UTC (rev 32455)
@@ -77,6 +77,7 @@
 #include <ctype.h>
 #include <unistd.h>
 #include <stdarg.h>
+#include <sys/types.h>
 #include <grass/gis.h>
 #include <grass/glocale.h>
 #include <grass/spawn.h>
@@ -2604,8 +2605,16 @@
 			    if ( G_find_file (element, opt->answer, G_mapset()) ) /* found */
 			    {
 				if ( !overwrite && !over ) { 
-				    fprintf(stderr, _("ERROR: option <%s>: <%s> exists.\n"), 
-						   opt->key, opt->answer );
+				    if ( G_info_format() != G_INFO_FORMAT_GUI ) {
+					fprintf(stderr, _("ERROR: option <%s>: <%s> exists.\n"), 
+						opt->key, opt->answer );
+				    }
+				    else {
+					fprintf(stderr, "GRASS_INFO_ERROR(%d,1): option <%s>: <%s> exists.\n",
+						getpid(), opt->key, opt->answer);
+					fprintf(stderr, "GRASS_INFO_END(%d,1)\n",
+						getpid());
+				    }
 
 				    error = 1;
 				}



More information about the grass-commit mailing list