Skip to content

Commit

Permalink
v.to.db history support files (#486)
Browse files Browse the repository at this point in the history
* Vect_open_update => Vect_open_update_head to keep support files

* Vect_open_update_head check
  • Loading branch information
HuidaeCho committed Apr 4, 2020
1 parent 44bc9e9 commit 7f6c10c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions vector/v.to.db/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 7f6c10c

Please sign in to comment.