[GRASS-SVN] r55762 - grass/trunk/lib/vector/Vlib
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Apr 13 11:57:09 PDT 2013
Author: martinl
Date: 2013-04-13 11:57:08 -0700 (Sat, 13 Apr 2013)
New Revision: 55762
Modified:
grass/trunk/lib/vector/Vlib/field.c
Log:
vlib: Vect_map_del_dblink(): -1 to delete all dblinks
Modified: grass/trunk/lib/vector/Vlib/field.c
===================================================================
--- grass/trunk/lib/vector/Vlib/field.c 2013-04-13 16:40:47 UTC (rev 55761)
+++ grass/trunk/lib/vector/Vlib/field.c 2013-04-13 18:57:08 UTC (rev 55762)
@@ -116,7 +116,7 @@
\brief Delete db connection from Map_info structure
\param Map pointer to Map_info structure
- \param field layer number
+ \param field layer number (-1 to delete all dblinks)
\return 0 deleted
\return -1 error
@@ -131,7 +131,7 @@
ret = -1;
for (i = 0; i < links->n_fields; i++) {
- if (links->field[i].number == field) { /* field found */
+ if (field < 0 || links->field[i].number == field) { /* field found */
for (j = i; j < links->n_fields - 1; j++) {
links->field[j].number = links->field[j + 1].number;
links->field[j].name = links->field[j + 1].name;
More information about the grass-commit
mailing list