[GRASS-SVN] r30662 - grass/branches/releasebranch_6_3/vector/v.edit

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Mar 20 17:49:22 EDT 2008


Author: martinl
Date: 2008-03-20 17:49:22 -0400 (Thu, 20 Mar 2008)
New Revision: 30662

Modified:
   grass/branches/releasebranch_6_3/vector/v.edit/main.c
Log:
v.edit: do not overwrite vector map by default (tool=create) (backported from trunk)

Modified: grass/branches/releasebranch_6_3/vector/v.edit/main.c
===================================================================
--- grass/branches/releasebranch_6_3/vector/v.edit/main.c	2008-03-20 21:45:58 UTC (rev 30661)
+++ grass/branches/releasebranch_6_3/vector/v.edit/main.c	2008-03-20 21:49:22 UTC (rev 30662)
@@ -79,6 +79,17 @@
     }
 
     if (action_mode == MODE_CREATE) {
+	int overwrite;
+	overwrite = G_check_overwrite(argc, argv);
+	if (G_find_vector2(params.map -> answer, G_mapset()) ) {
+	    if (overwrite)
+		G_warning (_("Vector map <%s> already exists and will be overwritten"),
+			   params.map -> answer);
+	    else
+		G_fatal_error (_("Vector map <%s> already exists"),
+			       params.map -> answer);
+	}
+	
 	/* 3D vector maps? */
 	ret = Vect_open_new (&Map, params.map -> answer, WITHOUT_Z);
 	if (ret == -1) {



More information about the grass-commit mailing list