Browse Source

parser.c: print 'option <%s>: <%s> exists' message in gui style if GRASS_MESSAGE_FORMAT=gui

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32453 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 17 years ago
parent
commit
4168d405ba
1 changed files with 11 additions and 2 deletions
  1. 11 2
      lib/gis/parser.c

+ 11 - 2
lib/gis/parser.c

@@ -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 @@ static int check_overwrite (void)
 			    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;
 				}