Prechádzať zdrojové kódy

v.to.db history support files (#486)

* Vect_open_update => Vect_open_update_head to keep support files

* Vect_open_update_head check
Huidae Cho 5 rokov pred
rodič
commit
7f6c10cf17
1 zmenil súbory, kde vykonal 9 pridanie a 2 odobranie
  1. 9 2
      vector/v.to.db/main.c

+ 9 - 2
vector/v.to.db/main.c

@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
 
     /* open map */
     Vect_set_open_level(2);
-    if (Vect_open_update(&Map, options.name, "") < 0)
+    if (Vect_open_old(&Map, options.name, "") < 0)
 	G_fatal_error(_("Unable to open vector map <%s>"), options.name);
     Vect_set_error_handler_io(&Map, NULL);
    
@@ -389,13 +389,20 @@ int main(int argc, char *argv[])
     else {
 	update(&Map);
 	Vect_set_db_updated(&Map);
-	Vect_hist_command(&Map);
     }
 
     Vect_close(&Map);
 
     if (!(options.print || options.total)) {
 	print_stat();
+
+	if (Vect_open_update_head(&Map, options.name, "") < 0)
+	    G_warning(_("Unable to write history for vector map <%s>"),
+		      options.name);
+	else {
+	    Vect_hist_command(&Map);
+	    Vect_close(&Map);
+	}
     }
 
     /* free list */