[GRASS-SVN] r40852 -
grass/branches/releasebranch_6_4/visualization/nviz/src
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Feb 7 20:27:09 EST 2010
Author: hamish
Date: 2010-02-07 20:27:07 -0500 (Sun, 07 Feb 2010)
New Revision: 40852
Modified:
grass/branches/releasebranch_6_4/visualization/nviz/src/nviz_init.c
Log:
glynn: Pass executable name separately (no longer in argv[])
(backport from trunk, r40835)
Modified: grass/branches/releasebranch_6_4/visualization/nviz/src/nviz_init.c
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/src/nviz_init.c 2010-02-08 00:11:27 UTC (rev 40851)
+++ grass/branches/releasebranch_6_4/visualization/nviz/src/nviz_init.c 2010-02-08 01:27:07 UTC (rev 40852)
@@ -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", interp->result);
@@ -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