[GRASS-SVN] r38645 - grass/trunk/lib/vector/diglib

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Aug 8 14:50:46 EDT 2009


Author: mmetz
Date: 2009-08-08 14:50:46 -0400 (Sat, 08 Aug 2009)
New Revision: 38645

Modified:
   grass/trunk/lib/vector/diglib/spindex_rw.c
Log:
read sidx: adjusted order of checks

Modified: grass/trunk/lib/vector/diglib/spindex_rw.c
===================================================================
--- grass/trunk/lib/vector/diglib/spindex_rw.c	2009-08-08 11:47:28 UTC (rev 38644)
+++ grass/trunk/lib/vector/diglib/spindex_rw.c	2009-08-08 18:50:46 UTC (rev 38645)
@@ -276,12 +276,6 @@
     byte_order = buf[4];
     ptr->spidx_port.off_t_size = buf[5];
 
-    if (ptr->spidx_port.off_t_size > (int)sizeof(off_t)) {
-	G_fatal_error("Spatial index was written with LFS but this "
-		      "GRASS version does not support LFS. "
-		      "Try to rebuild topology or upgrade GRASS.");
-    }
-
     G_debug(2,
 	    "Spidx header: file version %d.%d , supported from GRASS version %d.%d",
 	    ptr->spidx_Version_Major, ptr->spidx_Version_Minor,
@@ -320,6 +314,13 @@
 	    return (-1);
     }
 
+    /* can this library read the sidx file ? */
+    if (ptr->spidx_port.off_t_size > (int)sizeof(off_t)) {
+	G_fatal_error("Spatial index was written with LFS but this "
+		      "GRASS version does not support LFS. "
+		      "Please get a GRASS version with LFS support.");
+    }
+
     dig_init_portable(&(ptr->spidx_port), byte_order);
     dig_set_cur_port(&(ptr->spidx_port));
 



More information about the grass-commit mailing list