Bladeren bron

allow spaces in EPS file pathname (merge from devbr6)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@46167 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 14 jaren geleden
bovenliggende
commit
feb1e2c7d6
4 gewijzigde bestanden met toevoegingen van 9 en 4 verwijderingen
  1. 1 1
      ps/ps.map/do_plt.c
  2. 3 2
      ps/ps.map/eps.c
  3. 3 0
      ps/ps.map/map_info.c
  4. 2 1
      ps/ps.map/r_plt.c

+ 1 - 1
ps/ps.map/do_plt.c

@@ -152,7 +152,7 @@ int do_plt(int after_masking)
 	    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;

+ 3 - 2
ps/ps.map/eps.c

@@ -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 @@ int eps_bbox(char *eps, double *llx, double *lly, double *urx, double *ury)
 
     /* 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 @@ int eps_bbox(char *eps, double *llx, double *lly, double *urx, double *ury)
 	    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);
 }

+ 3 - 0
ps/ps.map/map_info.c

@@ -25,6 +25,7 @@ int map_info(void)
 
     /* get text location */
     dy = fontsize;
+
     if (m_info.x > 0.0)
 	x = 72.0 * m_info.x;
     else
@@ -33,7 +34,9 @@ int map_info(void)
 	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;
 

+ 2 - 1
ps/ps.map/r_plt.c

@@ -1,6 +1,7 @@
 #include <string.h>
 #include <grass/colors.h>
 #include <grass/raster.h>
+#include <grass/glocale.h>
 #include "local_proto.h"
 
 #define KEY(x)(strcmp(key,x)==0)
@@ -155,7 +156,7 @@ int read_eps(double e, double n)
 
 	    /* 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);