[GRASS-SVN] r45309 - grass/trunk/ps/ps.map
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Feb 4 04:13:15 EST 2011
Author: hamish
Date: 2011-02-04 01:13:15 -0800 (Fri, 04 Feb 2011)
New Revision: 45309
Modified:
grass/trunk/ps/ps.map/main.c
Log:
bah, map_setup wants to write to the file. figure something else out later
Modified: grass/trunk/ps/ps.map/main.c
===================================================================
--- grass/trunk/ps/ps.map/main.c 2011-02-04 09:04:48 UTC (rev 45308)
+++ grass/trunk/ps/ps.map/main.c 2011-02-04 09:13:15 UTC (rev 45309)
@@ -257,20 +257,19 @@
copies_set = 1;
}
- if(!bflag->answer) {
- if (output_file->answer) {
- if ((PS.fp = fopen(output_file->answer, "w")) == NULL)
- G_fatal_error("%s - %s: %s", G_program_name(),
- output_file->answer, strerror(errno));
- }
- else {
- G_message(_("\nERROR: Required parameter <%s> not set:\n (%s).\n"),
- output_file->key, output_file->description);
- G_usage();
- exit(EXIT_FAILURE);
- }
+ if (output_file->answer) {
+ if ((PS.fp = fopen(output_file->answer, "w")) == NULL)
+ G_fatal_error("%s - %s: %s", G_program_name(),
+ output_file->answer, strerror(errno));
}
+ else {
+ G_message(_("\nERROR: Required parameter <%s> not set:\n (%s).\n"),
+ output_file->key, output_file->description);
+ G_usage();
+ exit(EXIT_FAILURE);
+ }
+
/* get current mapset */
PS.cell_mapset = G_mapset();
@@ -728,6 +727,7 @@
fprintf(stdout, "bbox=%.3f,%.3f,%.3f,%.3f\n", PS.map_left / 72.0,
PS.map_top / 72.0, PS.map_right / 72.0, PS.map_bot / 72.0);
/* +/- 0.5 ? see ps.map.c brd.* */
+ unlink(output_file->answer); /* fixme: don't open it in the first place */
exit(EXIT_SUCCESS);
}
More information about the grass-commit
mailing list