[GRASS-SVN] r40835 - grass/trunk/visualization/nviz/src
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Feb 5 18:59:16 EST 2010
Author: glynn
Date: 2010-02-05 18:59:16 -0500 (Fri, 05 Feb 2010)
New Revision: 40835
Modified:
grass/trunk/visualization/nviz/src/nviz_init.c
Log:
Pass executable name separately (no longer in argv[])
Modified: grass/trunk/visualization/nviz/src/nviz_init.c
===================================================================
--- grass/trunk/visualization/nviz/src/nviz_init.c 2010-02-05 22:15:16 UTC (rev 40834)
+++ grass/trunk/visualization/nviz/src/nviz_init.c 2010-02-05 23:59:16 UTC (rev 40835)
@@ -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;
@@ -162,7 +163,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));
@@ -368,6 +369,7 @@
*/
static int Ngetargs(Tcl_Interp * interp, /* Current interpreter. */
+ const char **p_cmd,
const char **p_argv0,
const char ***p_argv)
{
@@ -385,6 +387,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;
@@ -524,11 +528,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);
@@ -540,7 +544,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