[GRASS-SVN] r54872 - grass/trunk/vector/v.in.ogr

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Feb 3 07:08:43 PST 2013


Author: mmetz
Date: 2013-02-03 07:08:42 -0800 (Sun, 03 Feb 2013)
New Revision: 54872

Modified:
   grass/trunk/vector/v.in.ogr/main.c
Log:
v.in.ogr: fix r54839 for wingrass

Modified: grass/trunk/vector/v.in.ogr/main.c
===================================================================
--- grass/trunk/vector/v.in.ogr/main.c	2013-02-03 14:19:07 UTC (rev 54871)
+++ grass/trunk/vector/v.in.ogr/main.c	2013-02-03 15:08:42 UTC (rev 54872)
@@ -334,11 +334,19 @@
 
     /* set up encoding for attribute data */
     if (param.encoding->answer) {
+	char *buf;
+	int len;
+	
+	len = strlen("SHAPE_ENCODING") + strlen(param.encoding->answer) + 2;
+	buf = G_malloc(len * sizeof(char));
         /* -> Esri Shapefile */
-        setenv("SHAPE_ENCODING", param.encoding->answer, 1);
+	sprintf(buf, "SHAPE_ENCODING=%s", param.encoding->answer);
+	putenv(buf);
         /* -> DXF */
-        setenv("DXF_ENCODING", param.encoding->answer, 1);
+	sprintf(buf, "DXF_ENCODING=%s", param.encoding->answer);
+	putenv(buf);
         /* todo: others ? */
+	G_free(buf);
     }
 
     /* open OGR DSN */



More information about the grass-commit mailing list