浏览代码

d.mon: store output as full path

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63449 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 年之前
父节点
当前提交
17d52a39b3
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      display/d.mon/start.c

+ 8 - 4
display/d.mon/start.c

@@ -14,13 +14,16 @@ static void start_wx(const char *, const char *, const char *,
 void start(const char *name, const char *output)
 {
     char *env_name;
+    const char *output_path;
 
-    if (!output)
-	return;
-
+    output_path = realpath(output, NULL);
+    if (!output_path) {
+        G_debug(1, "Unable to get full path for '%s'", output);
+        output_path = output;
+    }
     env_name = NULL;
     G_asprintf(&env_name, "MONITOR_%s_MAPFILE", G_store_upper(name));
-    G_setenv(env_name, output);
+    G_setenv(env_name, output_path);
 }
 
 /* start wxGUI display monitor */
@@ -73,6 +76,7 @@ int start_mon(const char *name, const char *output, int select,
         G_fatal_error(_("Monitor <%s> already running"), name);
     }
 
+    /* write env file */
     tempfile = G_tempfile();
 
     u_name = G_store_upper(name);