[GRASS-SVN] r42303 - grass/trunk/vector/v.info
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue May 18 10:00:22 EDT 2010
Author: mmetz
Date: 2010-05-18 10:00:20 -0400 (Tue, 18 May 2010)
New Revision: 42303
Modified:
grass/trunk/vector/v.info/main.c
Log:
add safety check (backport from devbr)
Modified: grass/trunk/vector/v.info/main.c
===================================================================
--- grass/trunk/vector/v.info/main.c 2010-05-18 13:59:18 UTC (rev 42302)
+++ grass/trunk/vector/v.info/main.c 2010-05-18 14:00:20 UTC (rev 42303)
@@ -46,7 +46,7 @@
if (!level1_flag) {
/* try to open head-only on level 2 */
- if (Vect_open_old_head2(&Map, input_opt, "", field_opt) == 1) {
+ if (Vect_open_old_head2(&Map, input_opt, "", field_opt) < 2) {
G_warning(_("Unable to open vector map <%s> on level 2, using level 1"),
Vect_get_full_name(&Map));
Vect_close(&Map);
@@ -58,7 +58,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_old2(&Map, input_opt, "", field_opt);
+ if (Vect_open_old2(&Map, input_opt, "", field_opt) < 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