瀏覽代碼

v.to.db: test exit status of Vect_open_old()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64072 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 10 年之前
父節點
當前提交
cf15d28a5e
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      vector/v.to.db/main.c

+ 2 - 1
vector/v.to.db/main.c

@@ -55,7 +55,8 @@ int main(int argc, char *argv[])
 
 
     /* open map */
     /* open map */
     Vect_set_open_level(2);
     Vect_set_open_level(2);
-    Vect_open_old(&Map, options.name, "");
+    if (Vect_open_old(&Map, options.name, "") < 0)
+	G_fatal_error(_("Unable to open vector map <%s>"), options.name);
     Vect_set_error_handler_io(&Map, NULL);
     Vect_set_error_handler_io(&Map, NULL);
    
    
     Fi = Vect_get_field(&Map, options.field);
     Fi = Vect_get_field(&Map, options.field);