[GRASS-SVN] r50504 - grass/trunk/vector/v.info

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 27 16:33:19 EST 2012


Author: martinl
Date: 2012-01-27 13:33:19 -0800 (Fri, 27 Jan 2012)
New Revision: 50504

Modified:
   grass/trunk/vector/v.info/print.c
Log:
v.info: fix map type check


Modified: grass/trunk/vector/v.info/print.c
===================================================================
--- grass/trunk/vector/v.info/print.c	2012-01-27 21:17:10 UTC (rev 50503)
+++ grass/trunk/vector/v.info/print.c	2012-01-27 21:33:19 UTC (rev 50504)
@@ -226,7 +226,7 @@
 
 void print_info(const struct Map_info *Map)
 {
-    int i;
+    int i, map_type;
     char line[100];
     char tmp1[100], tmp2[100];
     char timebuff[256];
@@ -235,6 +235,8 @@
     struct bound_box box;
     int utm_zone = -1;
    
+    map_type = Vect_maptype(Map);
+    
     /* Check the Timestamp */
     time_ok = G_read_vector_timestamp(Vect_get_name(Map), NULL, "", &ts);
 
@@ -247,7 +249,8 @@
     }
 
     divider('+');
-    if (Vect_maptype(Map) & (GV_FORMAT_OGR | GV_FORMAT_OGR_DIRECT)) {
+    if (map_type == GV_FORMAT_OGR ||
+	map_type == GV_FORMAT_OGR_DIRECT) {
 	/* for OGR format print also datasource and layer */
 	sprintf(line, "%-17s%s", _("OGR layer:"),
 		Vect_get_ogr_layer_name(Map));
@@ -278,7 +281,8 @@
 	    Vect_get_scale(Map));
     printline(line);
 
-    if (Vect_maptype(Map) & (GV_FORMAT_OGR | GV_FORMAT_OGR_DIRECT)) {
+    if (map_type == GV_FORMAT_OGR ||
+	map_type == GV_FORMAT_OGR_DIRECT) {
 	sprintf(line, "%-17s%s (%s)", _("Map format:"),
 		Vect_maptype_info(Map), Vect_get_ogr_format_info(Map));
     }



More information about the grass-commit mailing list