Browse Source

read sidx: adjusted order of checks

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38645 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 15 years ago
parent
commit
994ac90a94
1 changed files with 7 additions and 6 deletions
  1. 7 6
      lib/vector/diglib/spindex_rw.c

+ 7 - 6
lib/vector/diglib/spindex_rw.c

@@ -276,12 +276,6 @@ int dig_Rd_spidx_head(struct gvfile * fp, struct Plus_head *ptr)
     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 @@ int dig_Rd_spidx_head(struct gvfile * fp, struct Plus_head *ptr)
 	    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));