Przeglądaj źródła

v.info: switch to level1 if vector map cannot be open on level 2

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@39196 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 lat temu
rodzic
commit
8e4c97c094
1 zmienionych plików z 9 dodań i 6 usunięć
  1. 9 6
      vector/v.info/main.c

+ 9 - 6
vector/v.info/main.c

@@ -51,16 +51,19 @@ int main(int argc, char *argv[])
 	topo_flag = 0;
     }
     
+    if (!level1_flag) {
+	 /* level 2 */
+	if (Vect_open_old_head2(&Map, input_opt, "", field_opt) < 2) {
+	    G_warning(_("Unable to open vector map <%s> on level 2"),
+		      Vect_get_full_name(&Map));
+	    level1_flag = 1;
+	}
+    }
+
     if (level1_flag) {
 	Vect_open_old2(&Map, input_opt, "", field_opt);      /* level 1 */
 	level_one_info(&Map);
     }
-    else {
-	 /* level 2 */
-	if (Vect_open_old_head2(&Map, input_opt, "", field_opt) < 2)
-	    G_fatal_error(_("Unable to open vector map <%s> on level 2"),
-			  Vect_get_full_name(&Map));
-    }
 
     if (hist_flag) {
 	char buf[1001];