[GRASS-SVN] r45170 - grass/branches/develbranch_6/imagery/i.rectify

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jan 24 04:21:32 EST 2011


Author: mmetz
Date: 2011-01-24 01:21:32 -0800 (Mon, 24 Jan 2011)
New Revision: 45170

Modified:
   grass/branches/develbranch_6/imagery/i.rectify/exec.c
   grass/branches/develbranch_6/imagery/i.rectify/main.c
Log:
0 -> NULL; copy history if possible

Modified: grass/branches/develbranch_6/imagery/i.rectify/exec.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.rectify/exec.c	2011-01-24 09:20:57 UTC (rev 45169)
+++ grass/branches/develbranch_6/imagery/i.rectify/exec.c	2011-01-24 09:21:32 UTC (rev 45170)
@@ -50,7 +50,8 @@
 	    colr_ok = G_read_colors(name, mapset, &colr) > 0;
 
 	    /* Initialze History */
-	    G_short_history(name, type, &hist);
+	    if (G_read_history(name, mapset, &hist) < 0)
+		G_short_history(result, type, &hist);
 
 	    time(&start_time);
 
@@ -66,12 +67,8 @@
 		    G_free_colors(&colr);
 		}
 
-		/* Write out History Structure History */
-		sprintf(hist.title, "%s", result);
-		sprintf(hist.datsrc_1, "%s", name);
-		sprintf(hist.edhist[0], "Created from: i.rectify");
-		sprintf(hist.edhist[1], "Transformation order = %d", order);
-		hist.edlinecnt = 2;
+		/* Write out History */
+		G_command_history(&hist);
 		G_write_history(result, &hist);
 
 		select_current_env();

Modified: grass/branches/develbranch_6/imagery/i.rectify/main.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.rectify/main.c	2011-01-24 09:20:57 UTC (rev 45169)
+++ grass/branches/develbranch_6/imagery/i.rectify/main.c	2011-01-24 09:21:32 UTC (rev 45170)
@@ -214,7 +214,7 @@
 	    }
 	    else {
 		name = ifile->answers[m];
-		mapset = 0;
+		mapset = NULL;
 	    }
 
 	    got_file = 0;



More information about the grass-commit mailing list