[GRASS-SVN] r38126 - grass/trunk/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jun 30 12:12:09 EDT 2009


Author: glynn
Date: 2009-06-30 12:12:09 -0400 (Tue, 30 Jun 2009)
New Revision: 38126

Modified:
   grass/trunk/lib/gis/parser.c
Log:
Pass full pathname to menuform.py


Modified: grass/trunk/lib/gis/parser.c
===================================================================
--- grass/trunk/lib/gis/parser.c	2009-06-30 16:00:29 UTC (rev 38125)
+++ grass/trunk/lib/gis/parser.c	2009-06-30 16:12:09 UTC (rev 38126)
@@ -117,6 +117,7 @@
     struct GModule module_info;	/* general information on the corresponding module */
 
     const char *pgm_name;
+    const char *pgm_path;
 
     struct Flag first_flag;	/* First flag in a linked list      */
     struct Flag *current_flag;	/* Pointer for traversing list      */
@@ -760,7 +761,9 @@
 
     error = 0;
     need_first_opt = 1;
-    i = strlen(tmp_name = G_store(argv[0]));
+    tmp_name = G_store(argv[0]);
+    st->pgm_path = tmp_name;
+    i = strlen(tmp_name);
     while (--i >= 0) {
 	if (G_is_dirsep(tmp_name[i])) {
 	    tmp_name += i + 1;
@@ -1858,14 +1861,14 @@
 {
     char script[GPATH_MAX];
 
-    if (!st->pgm_name)
-	st->pgm_name = G_program_name();
-    if (!st->pgm_name)
+    if (!st->pgm_path)
+	st->pgm_path = G_program_name();
+    if (!st->pgm_path)
 	G_fatal_error(_("Unable to determine program name"));
 
     sprintf(script, "%s/etc/wxpython/gui_modules/menuform.py",
 	    getenv("GISBASE"));
-    G_spawn(getenv("GRASS_PYTHON"), "menuform.py", script, st->pgm_name, NULL);
+    G_spawn(getenv("GRASS_PYTHON"), "menuform.py", script, st->pgm_path, NULL);
 }
 
 /*!



More information about the grass-commit mailing list