[GRASS-SVN] r52791 - grass/branches/releasebranch_6_4/vector/v.transform

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 20 10:57:22 PDT 2012


Author: mmetz
Date: 2012-08-20 10:57:21 -0700 (Mon, 20 Aug 2012)
New Revision: 52791

Modified:
   grass/branches/releasebranch_6_4/vector/v.transform/trans_digit.c
Log:
v.transform close database shutdown driver when done

Modified: grass/branches/releasebranch_6_4/vector/v.transform/trans_digit.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.transform/trans_digit.c	2012-08-20 16:33:36 UTC (rev 52790)
+++ grass/branches/releasebranch_6_4/vector/v.transform/trans_digit.c	2012-08-20 17:57:21 UTC (rev 52791)
@@ -32,7 +32,7 @@
 		     int shift_file, double ztozero, double *trans_params_def,
 		     char *table, char **columns, int field)
 {
-    int i, type, cat;
+    int i, type, cat, ret;
     unsigned int j;
     double *trans_params;
     double ang, x, y;
@@ -65,14 +65,19 @@
 	ang = PI * trans_params[IDX_ZROT] / 180;
     }
 
+    ret = 1;
     while (1) {
 	type = Vect_read_next_line(Old, Points, Cats);
 
-	if (type == -1)		/* error */
-	    return 0;
+	if (type == -1)	{	/* error */
+	    ret = 0;
+	    break;
+	}
 
-	if (type == -2)		/* EOF */
-	    return 1;
+	if (type == -2) {	/* EOF */
+	    ret = 1;
+	    break;
+	}
 
 	/* get transformation parameters */
 	if (table) {
@@ -160,4 +165,6 @@
 	db_close_database_shutdown_driver(driver);
 	G_free((void *)trans_params);
     }
+    
+    return ret;
 }



More information about the grass-commit mailing list