Browse Source

vlib: fix Vect_option_to_types() for `type=auto` (v.out.ogr)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@56396 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 years ago
parent
commit
a86e5f71ab
1 changed files with 7 additions and 5 deletions
  1. 7 5
      lib/vector/Vlib/type.c

+ 7 - 5
lib/vector/Vlib/type.c

@@ -25,10 +25,13 @@
  */
  */
 int Vect_option_to_types(const struct Option *type_opt)
 int Vect_option_to_types(const struct Option *type_opt)
 {
 {
-    int i = 0;
-    int type = 0;
-
-    while (type_opt->answers[i]) {
+    int i, type;
+    
+    type = 0;
+    for(i = 0; type_opt->answers[i]; i++) {
+        if (strcmp(type_opt->answers[i], "auto") == 0)
+            continue;
+        
 	switch (type_opt->answers[i][0]) {
 	switch (type_opt->answers[i][0]) {
 	case 'p':
 	case 'p':
 	    type |= GV_POINT;
 	    type |= GV_POINT;
@@ -55,7 +58,6 @@ int Vect_option_to_types(const struct Option *type_opt)
 	    type |= GV_VOLUME;
 	    type |= GV_VOLUME;
 	    break;
 	    break;
 	}
 	}
-	i++;
     }
     }
 
 
     return type;
     return type;