[GRASS-SVN] r37805 - grass/branches/develbranch_6/ps/ps.map
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jun 10 09:30:35 EDT 2009
Author: hamish
Date: 2009-06-10 09:30:34 -0400 (Wed, 10 Jun 2009)
New Revision: 37805
Modified:
grass/branches/develbranch_6/ps/ps.map/r_plt.c
grass/branches/develbranch_6/ps/ps.map/r_vareas.c
Log:
expand $GISBASE if present in eps filename
Modified: grass/branches/develbranch_6/ps/ps.map/r_plt.c
===================================================================
--- grass/branches/develbranch_6/ps/ps.map/r_plt.c 2009-06-10 13:26:21 UTC (rev 37804)
+++ grass/branches/develbranch_6/ps/ps.map/r_plt.c 2009-06-10 13:30:34 UTC (rev 37805)
@@ -106,7 +106,7 @@
int read_eps(double e, double n)
{
- char buf[1024];
+ char buf[1024], eps_file[GPATH_MAX];
char *eps;
double scale, rotate;
int have_eps;
@@ -140,7 +140,18 @@
if (KEY("epsfile")) {
G_chop(data);
- eps = G_store(data);
+
+ /* expand "$GISBASE" if present */
+ if (strncmp(data, "$GISBASE", 8) != 0)
+ strcpy(eps_file, data);
+ else {
+ strcpy(eps_file, G_gisbase());
+ data += 8;
+ strcat(eps_file, data);
+ }
+
+ eps = G_store(eps_file);
+
/* test if file is accessible */
if ((fp = fopen(eps, "r")) == NULL)
error(key, data, "Can't open eps file");
Modified: grass/branches/develbranch_6/ps/ps.map/r_vareas.c
===================================================================
--- grass/branches/develbranch_6/ps/ps.map/r_vareas.c 2009-06-10 13:26:21 UTC (rev 37804)
+++ grass/branches/develbranch_6/ps/ps.map/r_vareas.c 2009-06-10 13:30:34 UTC (rev 37805)
@@ -34,7 +34,7 @@
int read_vareas(char *name, char *mapset)
{
char fullname[GNAME_MAX + GMAPSET_MAX + 5];
- char buf[1024];
+ char buf[1024], eps_file[GPATH_MAX];
char *key, *data;
double width;
int itmp, vec;
@@ -172,7 +172,17 @@
if (KEY("pat") || KEY("pattern")) {
G_chop(data);
- vector.layer[vec].pat = G_store(data);
+
+ /* expand "$GISBASE" if present */
+ if (strncmp(data, "$GISBASE", 8) != 0)
+ strcpy(eps_file, data);
+ else {
+ strcpy(eps_file, G_gisbase());
+ data += 8;
+ strcat(eps_file, data);
+ }
+
+ vector.layer[vec].pat = G_store(eps_file);
continue;
}
More information about the grass-commit
mailing list