فهرست منبع

don't fail if OGR layer name is defined

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@39197 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 سال پیش
والد
کامیت
d270a88e69
2فایلهای تغییر یافته به همراه5 افزوده شده و 3 حذف شده
  1. 3 1
      lib/vector/Vlib/open.c
  2. 2 2
      lib/vector/Vlib/open_ogr.c

+ 3 - 1
lib/vector/Vlib/open.c

@@ -163,7 +163,9 @@ int Vect__open_old(struct Map_info *Map, const char *name, const char *mapset, c
 	    G_debug(1, "OGR mapset detected");
 	    G_debug(1, "OGR mapset detected");
 	    ogr_mapset = 1;
 	    ogr_mapset = 1;
 	    Map->fInfo.ogr.dsn = G_store(xname);
 	    Map->fInfo.ogr.dsn = G_store(xname);
-	    Map->fInfo.ogr.layer_name = G_store(layer); /* no layer to be open */
+	    if (layer) {
+		Map->fInfo.ogr.layer_name = G_store(layer); /* no layer to be open */
+	    }
 	}
 	}
 	else {
 	else {
 	    sprintf(buf,  "%s/%s", GV_DIRECTORY, xname);
 	    sprintf(buf,  "%s/%s", GV_DIRECTORY, xname);

+ 2 - 2
lib/vector/Vlib/open_ogr.c

@@ -58,12 +58,12 @@ int V1_open_old_ogr(struct Map_info *Map, int update)
     }
     }
 
 
     if (!Map->fInfo.ogr.dsn) {
     if (!Map->fInfo.ogr.dsn) {
-	G_warning(_("OGR datasource not defined"));
+	G_fatal_error(_("OGR datasource not defined"));
 	return -1;
 	return -1;
     }
     }
     
     
     if (!Map->fInfo.ogr.layer_name) {
     if (!Map->fInfo.ogr.layer_name) {
-	G_warning(_("OGR layer not defined"));
+	G_fatal_error(_("OGR layer not defined"));
 	return -1;
 	return -1;
     }
     }