ソースを参照

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 年 前
コミット
a86e5f71ab
1 ファイル変更7 行追加5 行削除
  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 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]) {
 	case 'p':
 	    type |= GV_POINT;
@@ -55,7 +58,6 @@ int Vect_option_to_types(const struct Option *type_opt)
 	    type |= GV_VOLUME;
 	    break;
 	}
-	i++;
     }
 
     return type;