[GRASS-SVN] r40841 - grass/branches/develbranch_6/visualization/nviz/src

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 6 03:03:13 EST 2010


Author: hamish
Date: 2010-02-06 03:03:10 -0500 (Sat, 06 Feb 2010)
New Revision: 40841

Modified:
   grass/branches/develbranch_6/visualization/nviz/src/nviz_init.c
Log:
glynn: Pass executable name separately (no longer in argv[])
 (backport from trunk, r40835)


Modified: grass/branches/develbranch_6/visualization/nviz/src/nviz_init.c
===================================================================
--- grass/branches/develbranch_6/visualization/nviz/src/nviz_init.c	2010-02-06 06:14:26 UTC (rev 40840)
+++ grass/branches/develbranch_6/visualization/nviz/src/nviz_init.c	2010-02-06 08:03:10 UTC (rev 40841)
@@ -21,7 +21,8 @@
 int script_mode = 0;
 
 static int parse_command(Nv_data * data, Tcl_Interp * interp,	/* Current interpreter. */
-			 int argc, const char *argv0, const char **argv)
+			 int argc, const char *cmd, const char *argv0,
+			 const char **argv)
 {
     struct Option *elev, *colr, *vct, *pnt, *vol;
     struct Option *panel_path, *script, *state;
@@ -171,7 +172,7 @@
     }
 
     /* Put in the "please wait..." message unless we are in demo mode */
-    if ((strstr(argv[0], "nviz") != NULL) && (!demo->answer)) {
+    if ((strstr(cmd, "nviz") != NULL) && (!demo->answer)) {
 	if (Tcl_Eval(interp, startup_script) != TCL_OK)
 	    G_fatal_error("%s", Tcl_GetStringResult(interp));
 
@@ -377,6 +378,7 @@
  */
 
 static int Ngetargs(Tcl_Interp * interp,	/* Current interpreter. */
+		    const char **p_cmd,
 		    const char **p_argv0,
 		    const char ***p_argv)
 {
@@ -394,6 +396,8 @@
     G_debug(2, "nviz_init:argv=%s", argv);
     G_debug(2, "nviz_init:cmd=%s", cmd);
 
+    *p_cmd = cmd;
+
     tmp = G_store(argv0);
     G_convert_dirseps_from_host(tmp);
     argv0 = tmp;
@@ -539,11 +543,11 @@
 int Ninitdata(Tcl_Interp *interp,	/* Current interpreter. */
 	      Nv_data *data)
 {
-    const char *argv0;
+    const char *cmd, *argv0;
     const char **argv;
     int argc;
 
-    argc = Ngetargs(interp, &argv0, &argv);
+    argc = Ngetargs(interp, &cmd, &argv0, &argv);
 
     G_gisinit(argv0);
 
@@ -555,7 +559,7 @@
     data->NumCplanes = 0;
     data->CurCplane = 0;
     if (!script_mode)
-	parse_command(data, interp, argc, argv0, argv);
+	parse_command(data, interp, argc, cmd, argv0, argv);
 
     return (TCL_OK);
 }



More information about the grass-commit mailing list