[GRASS-SVN] r32448 - grass/trunk/vector/v.in.dxf

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Aug 1 11:07:32 EDT 2008


Author: martinl
Date: 2008-08-01 11:07:32 -0400 (Fri, 01 Aug 2008)
New Revision: 32448

Modified:
   grass/trunk/vector/v.in.dxf/main.c
Log:
v.in.dxf: don't overwrite output map if not specified by 'output' argument

Modified: grass/trunk/vector/v.in.dxf/main.c
===================================================================
--- grass/trunk/vector/v.in.dxf/main.c	2008-08-01 13:40:03 UTC (rev 32447)
+++ grass/trunk/vector/v.in.dxf/main.c	2008-08-01 15:07:32 UTC (rev 32448)
@@ -125,8 +125,9 @@
     }
     else {
 	/* make vector map name SQL compliant */
-	if (opt.output->answer)
+	if (opt.output->answer) {
 	    output = G_store(opt.output->answer);
+	}
 	else {
 	    char *p, *p2;
 
@@ -147,6 +148,11 @@
 	}
 
 	layers = opt.layers->answers;
+	
+	if(!G_check_overwrite(argc, argv) && G_find_vector2(output, G_mapset())) {
+	    G_fatal_error(_("Option <%s>: <%s> exists."),
+			  opt.output->key, output);
+	}
 
 	if (Vect_legal_filename(output) < 0)
 	    G_fatal_error(_("Use '%s' option to change vector map name"),



More information about the grass-commit mailing list