فهرست منبع

d.mon: fix https://trac.osgeo.org/grass/ticket/2509 (d.mon output overwrite)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63466 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 سال پیش
والد
کامیت
6bc679735b
1فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 7 1
      display/d.mon/start.c

+ 7 - 1
display/d.mon/start.c

@@ -24,7 +24,13 @@ void start(const char *name, const char *output)
         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;