[GRASS-SVN] r42302 - grass/branches/develbranch_6/vector/v.info
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue May 18 09:59:20 EDT 2010
Author: mmetz
Date: 2010-05-18 09:59:18 -0400 (Tue, 18 May 2010)
New Revision: 42302
Modified:
grass/branches/develbranch_6/vector/v.info/main.c
Log:
add safety check
Modified: grass/branches/develbranch_6/vector/v.info/main.c
===================================================================
--- grass/branches/develbranch_6/vector/v.info/main.c 2010-05-18 13:36:30 UTC (rev 42301)
+++ grass/branches/develbranch_6/vector/v.info/main.c 2010-05-18 13:59:18 UTC (rev 42302)
@@ -111,7 +111,7 @@
level1_flag = lflag->answer;
if (!level1_flag) {
/* try to open head-only on level 2 */
- if (Vect_open_old_head(&Map, in_opt->answer, "") == 1) {
+ if (Vect_open_old_head(&Map, in_opt->answer, "") < 2) {
G_warning(_("Unable to open vector map <%s> on level 2, using level 1"),
Vect_get_full_name(&Map));
Vect_close(&Map);
@@ -123,7 +123,8 @@
* NOTE: number of points, lines, boundaries, centroids, faces, kernels is still available */
if (level1_flag) {
Vect_set_open_level(1); /* no topology */
- Vect_open_old(&Map, in_opt->answer, "");
+ if (Vect_open_old(&Map, in_opt->answer, "") < 1)
+ G_fatal_error(_("Unable to open vector map <%s>"), Vect_get_full_name(&Map));
level_one_info(&Map);
}
More information about the grass-commit
mailing list