[GRASS-SVN] r39497 - grass/branches/develbranch_6/vector/lidar/v.lidar.growing

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 13 03:11:33 EDT 2009


Author: neteler
Date: 2009-10-13 03:11:25 -0400 (Tue, 13 Oct 2009)
New Revision: 39497

Modified:
   grass/branches/develbranch_6/vector/lidar/v.lidar.growing/main.c
Log:
work around G__name_is_fully_qualified() bug

Modified: grass/branches/develbranch_6/vector/lidar/v.lidar.growing/main.c
===================================================================
--- grass/branches/develbranch_6/vector/lidar/v.lidar.growing/main.c	2009-10-12 20:18:22 UTC (rev 39496)
+++ grass/branches/develbranch_6/vector/lidar/v.lidar.growing/main.c	2009-10-13 07:11:25 UTC (rev 39497)
@@ -68,6 +68,8 @@
     dbString sql;
     dbTable *table;
     dbCursor cursor;
+    const char *p;
+    int found;
 
 /*------------------------------------------------------------------------------------------*/
     /* Options' declaration */ ;
@@ -118,8 +120,19 @@
     /* Open input vector */
     Vect_check_input_output_name(in_opt->answer, out_opt->answer,
 				 GV_FATAL_EXIT);
-    if(G__name_is_fully_qualified(in_opt->answer, xname, xmapset) < 0 ) /* strip off mapset from input for SQL*/
-	G_fatal_error(_("Vector map <%s> not found"), xname);
+
+    sprintf(xname, "%s", in_opt->answer);
+    found = 0;
+    for (p = in_opt->answer; *p; p++)
+	if (*p == '@') {
+	    found = 1;
+	    break;
+	}
+
+    if (found) {
+	if (G__name_is_fully_qualified(in_opt->answer, xname, xmapset) < 0)	/* strip off mapset from input for SQL */
+	    G_fatal_error(_("Vector map <%s> not found"), xname);
+    }
     if ((mapset = G_find_vector2(in_opt->answer, "")) == NULL) {
 	G_fatal_error(_("Vector map <%s> not found"), in_opt->answer);
     }
@@ -171,13 +184,12 @@
     db_init_string(&sql);
     db_zero_string(&sql);
 
-    sprintf(buf, "SELECT Interp,ID FROM %s_edge_Interpolation",
-	    xname);
-    G_debug(1,"buf: %s", buf);
+    sprintf(buf, "SELECT Interp,ID FROM %s_edge_Interpolation", xname);
+    G_debug(1, "buf: %s", buf);
     db_append_string(&sql, buf);
 
     if (db_open_select_cursor(driver, &sql, &cursor, DB_SEQUENTIAL) != DB_OK)
-	G_fatal_error(_("Unable to create table <%s_edge_Interpolation>"), xname);
+	G_fatal_error(_("Unable to open table <%s_edge_Interpolation>"), xname);
 
     count_obj = 1;
 



More information about the grass-commit mailing list