Fossil SCM

Cherrypick the changes [389f9fca5d] and [d0233e1792] to skip adding script commands that have a NULL name or function pointer.

mistachkin 2011-11-05 02:54 trunk
Commit d6c6a433e712a874ea0b89c6212b34d5d3778189
1 file changed +3 -1
+3 -1
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -423,11 +423,13 @@
423423
void *pContext
424424
){
425425
int i;
426426
/* Add the Tcl integration commands to TH1. */
427427
for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){
428
- void *ctx = aCommand[i].pContext;
428
+ void *ctx;
429
+ if ( !aCommand[i].zName || !aCommand[i].xProc ) continue;
430
+ ctx = aCommand[i].pContext;
429431
/* Use Tcl interpreter for context? */
430432
if( !ctx ) ctx = pContext;
431433
Th_CreateCommand(interp, aCommand[i].zName, aCommand[i].xProc, ctx, 0);
432434
}
433435
return TH_OK;
434436
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -423,11 +423,13 @@
423 void *pContext
424 ){
425 int i;
426 /* Add the Tcl integration commands to TH1. */
427 for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){
428 void *ctx = aCommand[i].pContext;
 
 
429 /* Use Tcl interpreter for context? */
430 if( !ctx ) ctx = pContext;
431 Th_CreateCommand(interp, aCommand[i].zName, aCommand[i].xProc, ctx, 0);
432 }
433 return TH_OK;
434
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -423,11 +423,13 @@
423 void *pContext
424 ){
425 int i;
426 /* Add the Tcl integration commands to TH1. */
427 for(i=0; i<(sizeof(aCommand)/sizeof(aCommand[0])); i++){
428 void *ctx;
429 if ( !aCommand[i].zName || !aCommand[i].xProc ) continue;
430 ctx = aCommand[i].pContext;
431 /* Use Tcl interpreter for context? */
432 if( !ctx ) ctx = pContext;
433 Th_CreateCommand(interp, aCommand[i].zName, aCommand[i].xProc, ctx, 0);
434 }
435 return TH_OK;
436

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button