[GRASS-SVN] r63466 - grass/trunk/display/d.mon

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 10 01:37:08 PST 2014


Author: martinl
Date: 2014-12-10 01:37:08 -0800 (Wed, 10 Dec 2014)
New Revision: 63466

Modified:
   grass/trunk/display/d.mon/start.c
Log:
d.mon: fix #2509 (d.mon output overwrite)


Modified: grass/trunk/display/d.mon/start.c
===================================================================
--- grass/trunk/display/d.mon/start.c	2014-12-10 09:28:58 UTC (rev 63465)
+++ grass/trunk/display/d.mon/start.c	2014-12-10 09:37:08 UTC (rev 63466)
@@ -24,7 +24,13 @@
         output_name = D_get_file();
         if (!output_name) 
             return;
-        D_close_driver();
+        if (!G_get_overwrite() && access(output_name, F_OK) == 0) {
+            D_close_driver();
+            G_fatal_error(_("option <%s>: <%s> exists."),
+                          "output", output_name);
+        }
+        D_close_driver(); /* must be called after check because this
+                           * function produces default map file */
     }
     else {
         output_name = output;



More information about the grass-commit mailing list