[GRASS-SVN] r48888 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Oct 21 04:11:52 EDT 2011


Author: mmetz
Date: 2011-10-21 01:11:51 -0700 (Fri, 21 Oct 2011)
New Revision: 48888

Modified:
   grass/trunk/lib/vector/Vlib/ascii.c
   grass/trunk/lib/vector/Vlib/map.c
Log:
fix r48886

Modified: grass/trunk/lib/vector/Vlib/ascii.c
===================================================================
--- grass/trunk/lib/vector/Vlib/ascii.c	2011-10-20 21:33:32 UTC (rev 48887)
+++ grass/trunk/lib/vector/Vlib/ascii.c	2011-10-21 08:11:51 UTC (rev 48888)
@@ -366,7 +366,6 @@
 
     line = 0;
     while (TRUE) {
-	line++;
 	type = Vect_read_next_line(Map, Points, Cats);
 	if (type == -1 ) {      /* failure */
 	    if (columns) {
@@ -385,23 +384,30 @@
 	    break;
 	}
 
+	line++;
+
 	if (format == GV_ASCII_FORMAT_POINT && !(type & GV_POINTS))
 	    continue;
 
-	found = FALSE;
-	if (type == GV_BOUNDARY && Vect_level(Map) > 1) {
+	found = check_cat(ACats, Clist, cats, ncats);
+
+	if (!found && type == GV_BOUNDARY && Vect_level(Map) > 1) {
 	    Vect_get_line_areas(Map, line, &left, &right);
+	    if (left < 0)
+		left = Vect_get_isle_area(Map, abs(left));
 	    if (left > 0) {
 		Vect_get_area_cats(Map, left, ACats);
 		found = check_cat(ACats, Clist, cats, ncats);
 	    }
+	    if (right < 0)
+		right = Vect_get_isle_area(Map, abs(right));
 	    if (!found && right > 0) {
 		Vect_get_area_cats(Map, right, ACats);
 		found = check_cat(ACats, Clist, cats, ncats);
 	    }
 	}
 	
-	if (!found && !check_cat(Cats, Clist, cats, ncats))
+	if (!found)
 	    continue;
 	
 	if (ver < 5) {

Modified: grass/trunk/lib/vector/Vlib/map.c
===================================================================
--- grass/trunk/lib/vector/Vlib/map.c	2011-10-20 21:33:32 UTC (rev 48887)
+++ grass/trunk/lib/vector/Vlib/map.c	2011-10-21 08:11:51 UTC (rev 48888)
@@ -182,7 +182,7 @@
     if ((fd = open(src, O_RDONLY)) < 0)
 	return 1;
 
-    /* if((fd2 = open(dst, O_CREAT|O_TRUNC|O_WRONLY)) < 0) */
+    /* if((fd2 = open(dst, O_CREAT|O_TRUNC|O_WRONLY)) < 0) { */
     if ((f2 = fopen(dst, "w")) == NULL) {
 	close(fd);
 	return 1;



More information about the grass-commit mailing list