[GRASS-SVN] r55840 - grass/branches/develbranch_6/display/d.profile

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Apr 16 23:31:43 PDT 2013


Author: hamish
Date: 2013-04-16 23:31:43 -0700 (Tue, 16 Apr 2013)
New Revision: 55840

Modified:
   grass/branches/develbranch_6/display/d.profile/Range.c
Log:
close file once done with it (#1323), quote path

Modified: grass/branches/develbranch_6/display/d.profile/Range.c
===================================================================
--- grass/branches/develbranch_6/display/d.profile/Range.c	2013-04-17 06:03:37 UTC (rev 55839)
+++ grass/branches/develbranch_6/display/d.profile/Range.c	2013-04-17 06:31:43 UTC (rev 55840)
@@ -16,7 +16,8 @@
 
     /* write stats to a temp file */
     temp_fname = G_tempfile();
-    sprintf(stats_cmd, "r.stats -ci %s > %s\n", name, temp_fname);
+    sprintf(stats_cmd, "r.stats -ci \"%s\" > \"%s\"", name, temp_fname);
+    G_debug(3, "r.stats command=[%s]", stats_cmd);
     system(stats_cmd);
 
     /* open temp file and read the stats into a linked list */
@@ -45,6 +46,7 @@
 	    done = 1;
     }
 
+    fclose(temp_file);
     return 0;
 }
 



More information about the grass-commit mailing list