[GRASS-SVN] r46166 - grass/branches/develbranch_6/ps/ps.map

svn_grass at osgeo.org svn_grass at osgeo.org
Tue May 3 08:35:17 EDT 2011


Author: hamish
Date: 2011-05-03 05:35:17 -0700 (Tue, 03 May 2011)
New Revision: 46166

Modified:
   grass/branches/develbranch_6/ps/ps.map/do_plt.c
   grass/branches/develbranch_6/ps/ps.map/eps.c
   grass/branches/develbranch_6/ps/ps.map/map_info.c
   grass/branches/develbranch_6/ps/ps.map/r_plt.c
Log:
allow spaces in EPS file pathname

Modified: grass/branches/develbranch_6/ps/ps.map/do_plt.c
===================================================================
--- grass/branches/develbranch_6/ps/ps.map/do_plt.c	2011-05-03 12:29:48 UTC (rev 46165)
+++ grass/branches/develbranch_6/ps/ps.map/do_plt.c	2011-05-03 12:35:17 UTC (rev 46166)
@@ -152,7 +152,7 @@
 	    break;
 
 	case 'E':		/* EPS file */
-	    if (sscanf(buf, "E %d %lf %lf %lf %lf %s",
+	    if (sscanf(buf, "E %d %lf %lf %lf %lf %[^\n]s",
 		       &masked, &e1, &n1, &scale, &rotate, name) == 6) {
 		if (masked && after_masking)
 		    continue;

Modified: grass/branches/develbranch_6/ps/ps.map/eps.c
===================================================================
--- grass/branches/develbranch_6/ps/ps.map/eps.c	2011-05-03 12:29:48 UTC (rev 46165)
+++ grass/branches/develbranch_6/ps/ps.map/eps.c	2011-05-03 12:35:17 UTC (rev 46166)
@@ -1,5 +1,6 @@
 #include <math.h>
 #include <string.h>
+#include <grass/glocale.h>
 #include "local_proto.h"
 
 /*  test if file is realy EPS file and find bbox 
@@ -14,7 +15,7 @@
 
     /* test if file is realy eps and find bbox */
     if ((fp = fopen(eps, "r")) == NULL) {
-	fprintf(stderr, "can't open eps file <%s>\n", eps);
+	G_warning(_("Can't open eps file <%s>"), eps);
 	return (0);
     }
     /* test if first row contains '%!PS-Adobe-m.n EPSF-m.n' string */
@@ -33,7 +34,7 @@
 	    return (1);
 	}
     }
-    fprintf(stderr, "Bounding box in eps file <%s> was not found\n", eps);
+    G_warning(_("Bounding box in eps file <%s> was not found"), eps);
     fclose(fp);
     return (0);
 }

Modified: grass/branches/develbranch_6/ps/ps.map/map_info.c
===================================================================
--- grass/branches/develbranch_6/ps/ps.map/map_info.c	2011-05-03 12:29:48 UTC (rev 46165)
+++ grass/branches/develbranch_6/ps/ps.map/map_info.c	2011-05-03 12:35:17 UTC (rev 46166)
@@ -25,6 +25,7 @@
 
     /* get text location */
     dy = fontsize;
+
     if (m_info.x > 0.0)
 	x = 72.0 * m_info.x;
     else
@@ -33,7 +34,9 @@
 	y = 72.0 * (PS.page_height - m_info.y);
     else
 	y = PS.min_y;
+
     margin = 0.2 * fontsize;
+
     if (x < PS.map_left + margin)
 	x = PS.map_left + margin;
 

Modified: grass/branches/develbranch_6/ps/ps.map/r_plt.c
===================================================================
--- grass/branches/develbranch_6/ps/ps.map/r_plt.c	2011-05-03 12:29:48 UTC (rev 46165)
+++ grass/branches/develbranch_6/ps/ps.map/r_plt.c	2011-05-03 12:35:17 UTC (rev 46166)
@@ -1,4 +1,5 @@
 #include <string.h>
+#include <grass/glocale.h>
 #include "local_proto.h"
 
 #define KEY(x)(strcmp(key,x)==0)
@@ -153,7 +154,7 @@
 
 	    /* test if file is accessible */
 	    if ((fp = fopen(eps, "r")) == NULL)
-		error(key, data, "Can't open eps file");
+		error(key, data, _("Can't open eps file"));
 
 	    have_eps = 1;
 	    fclose(fp);



More information about the grass-commit mailing list