1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Add argc as a default global to match standard tcl environment. (CVS 3361)

FossilOrigin-Name: 533154099c9fe1238705eea03aba388dd71dc35e
This commit is contained in:
shess
2006-08-22 23:53:46 +00:00
parent fa9b4b1499
commit ad42c3a352
3 changed files with 12 additions and 9 deletions

View File

@@ -11,7 +11,7 @@
*************************************************************************
** A TCL Interface to SQLite
**
** $Id: tclsqlite.c,v 1.165 2006/07/17 00:02:45 drh Exp $
** $Id: tclsqlite.c,v 1.166 2006/08/22 23:53:46 shess Exp $
*/
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@@ -2220,6 +2220,9 @@ int TCLSH_MAIN(int argc, char **argv){
#endif
if( argc>=2 || TCLSH==2 ){
int i;
char zArgc[32];
sqlite3_snprintf(sizeof(zArgc), zArgc, "%d", argc-(3-TCLSH));
Tcl_SetVar(interp,"argc", zArgc, TCL_GLOBAL_ONLY);
Tcl_SetVar(interp,"argv0",argv[1],TCL_GLOBAL_ONLY);
Tcl_SetVar(interp,"argv", "", TCL_GLOBAL_ONLY);
for(i=3-TCLSH; i<argc; i++){