Changes On Branch tcl-argv0-only
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch tcl-argv0-only Excluding Merge-Ins

This is equivalent to a diff from e25f55dd4d to b82eacd569

2012-08-21
14:25
Tcl only uses argv0 so it is enough to transfer only that one argument. check-in: 7f96a71599 user: drh tags: trunk
14:15
Merge the mingw-w64 compiler warning fixes into trunk. check-in: d89b99e383 user: drh tags: trunk
13:29
Tcl only uses argv0, so it's enough to transfer this argument only Closed-Leaf check-in: b82eacd569 user: jan.nijtmans tags: tcl-argv0-only
13:26
Those two files tell eclipse that it can be checked out as a project, and that the LF eol-convention should be used. check-in: 6c945311bc user: jan.nijtmans tags: eclipse-project
11:05
Fix error messages associated with the "scrub" command. check-in: e25f55dd4d user: drh tags: trunk
2012-08-20
19:01
Expand the "diffFlags" variable to 64-bits in order to accommodate new options to the various "diff" commands. check-in: 2b1767500e user: drh tags: trunk

Changes to src/main.c.

    84     84   #ifdef FOSSIL_ENABLE_TCL
    85     85   /*
    86     86   ** All Tcl related context information is in this structure.  This structure
    87     87   ** definition has been copied from and should be kept in sync with the one in
    88     88   ** "th_tcl.c".
    89     89   */
    90     90   struct TclContext {
    91         -  int argc;
    92         -  char **argv;
           91  +  char *argv0;
    93     92     Tcl_Interp *interp;
    94     93   };
    95     94   #endif
    96     95   
    97     96   /*
    98     97   ** All global variables are in this structure.
    99     98   */
................................................................................
   410    409   int main(int argc, char **argv){
   411    410     const char *zCmdName = "unknown";
   412    411     int idx;
   413    412     int rc;
   414    413     int i;
   415    414   
   416    415   #ifdef FOSSIL_ENABLE_TCL
   417         -  g.tcl.argc = argc;
   418         -  g.tcl.argv = argv;
          416  +  g.tcl.argv0 = argv[0];
   419    417     g.tcl.interp = 0;
   420    418   #endif
   421    419   
   422    420     sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
   423    421     memset(&g, 0, sizeof(g));
   424    422     g.now = time(0);
   425    423     g.argc = argc;

Changes to src/th_tcl.c.

    91     91   }
    92     92   
    93     93   /*
    94     94   ** Tcl context information used by TH1.  This structure definition has been
    95     95   ** copied from and should be kept in sync with the one in "main.c".
    96     96   */
    97     97   struct TclContext {
    98         -  int argc;
    99         -  char **argv;
           98  +  char *argv0;
   100     99     Tcl_Interp *interp;
   101    100   };
   102    101   
   103    102   /*
   104    103   ** Syntax:
   105    104   **
   106    105   **   tclEval arg ?arg ...?
................................................................................
   339    338     return rc;
   340    339   }
   341    340   
   342    341   /*
   343    342   ** Array of Tcl integration commands.  Used when adding or removing the Tcl
   344    343   ** integration commands from TH1.
   345    344   */
   346         -static struct _Command {
          345  +static const struct _Command {
   347    346     const char *zName;
   348    347     Th_CommandProc xProc;
   349    348     void *pContext;
   350    349   } aCommand[] = {
   351    350     {"tclEval",   tclEval_command,   0},
   352    351     {"tclExpr",   tclExpr_command,   0},
   353    352     {"tclInvoke", tclInvoke_command, 0},
................................................................................
   387    386       Th_ErrorMessage(interp,
   388    387           "Invalid Tcl context", (const char *)"", 0);
   389    388       return TH_ERROR;
   390    389     }
   391    390     if ( tclContext->interp ){
   392    391       return TH_OK;
   393    392     }
   394         -  if ( tclContext->argc>0 && tclContext->argv ) {
   395         -    Tcl_FindExecutable(tclContext->argv[0]);
          393  +  if ( tclContext->argv0 ){
          394  +    Tcl_FindExecutable(tclContext->argv0);
   396    395     }
   397    396     tclInterp = tclContext->interp = Tcl_CreateInterp();
   398    397     if( !tclInterp || Tcl_InterpDeleted(tclInterp) ){
   399    398       Th_ErrorMessage(interp,
   400    399           "Could not create Tcl interpreter", (const char *)"", 0);
   401    400       return TH_ERROR;
   402    401     }