[GRASS-SVN] r36617 - grass/trunk/vector/v.in.dxf

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Apr 7 22:38:03 EDT 2009


Author: hcho
Date: 2009-04-07 22:38:03 -0400 (Tue, 07 Apr 2009)
New Revision: 36617

Modified:
   grass/trunk/vector/v.in.dxf/write_vect.c
Log:
Fixed table naming

Modified: grass/trunk/vector/v.in.dxf/write_vect.c
===================================================================
--- grass/trunk/vector/v.in.dxf/write_vect.c	2009-04-07 20:23:53 UTC (rev 36616)
+++ grass/trunk/vector/v.in.dxf/write_vect.c	2009-04-08 02:38:03 UTC (rev 36617)
@@ -123,9 +123,18 @@
 			 int *cat)
 {
     int i, type;
+    char x = 0;
 
-    /* make table name SQL compliant */
+    /* make table name SQL compliant: Vect_default_field_info returns
+     * mapname_layername in ->table, and mapname is always SQL compliant.
+     * Because layername is followed by mapname_, it (field_name here) can
+     * start with [a-zA-Z0-9]. No need to change the first digit to 'x'.
+     */
+    if (field_name[0] >= '0' && field_name[0] <= '9')
+	x = field_name[0];
     G_str_to_sql(field_name);
+    if (x)
+        field_name[0] = x;
 
     for (i = 0; i < num_fields; i++) {
 	/* field name already exists */



More information about the grass-commit mailing list