Fossil SCM

Fix more issues that were already fixed but overwritten by text editor errors and didn't get committed last time.

drh 2025-04-19 23:32 th1-taint
Commit bd45dc72ddf470cf0a704c5ed8a6d2149b0e1abc601ff25b4813a345a1b1cdf2
2 files changed +4 -2 +2 -2
+4 -2
--- src/th_main.c
+++ src/th_main.c
@@ -2049,11 +2049,11 @@
20492049
res = Th_Eval(interp, 0, argv[2], TH1_LEN(argl[2]));
20502050
if( g.thTrace ){
20512051
int nTrRes;
20522052
char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes);
20532053
Th_Trace("[query_eval] => %h {%#h}<br>\n",
2054
- Th_ReturnCodeName(res, 0), nTrRes, zTrRes);
2054
+ Th_ReturnCodeName(res, 0), TH1_LEN(nTrRes), zTrRes);
20552055
}
20562056
if( res==TH_BREAK || res==TH_CONTINUE ) res = TH_OK;
20572057
}
20582058
rc = sqlite3_finalize(pStmt);
20592059
if( rc!=SQLITE_OK ){
@@ -2763,10 +2763,11 @@
27632763
char *zResult = (char*)Th_GetResult(g.interp, &nResult);
27642764
/*
27652765
** Make sure that the TH1 script error was not caused by a "missing"
27662766
** command hook handler as that is not actually an error condition.
27672767
*/
2768
+ nResult = TH1_LEN(nResult);
27682769
if( memcmp(zResult, NO_COMMAND_HOOK_ERROR, nResult)!=0 ){
27692770
sendError(0,zResult, nResult, 0);
27702771
}else{
27712772
/*
27722773
** There is no command hook handler "installed". This situation
@@ -2850,10 +2851,11 @@
28502851
char *zResult = (char*)Th_GetResult(g.interp, &nResult);
28512852
/*
28522853
** Make sure that the TH1 script error was not caused by a "missing"
28532854
** webpage hook handler as that is not actually an error condition.
28542855
*/
2856
+ nResult = TH1_LEN(nResult);
28552857
if( memcmp(zResult, NO_WEBPAGE_HOOK_ERROR, nResult)!=0 ){
28562858
sendError(0,zResult, nResult, 1);
28572859
}else{
28582860
/*
28592861
** There is no webpage hook handler "installed". This situation
@@ -2990,11 +2992,11 @@
29902992
rc = Th_Eval(g.interp, 0, (const char*)z, i);
29912993
if( g.thTrace ){
29922994
int nTrRes;
29932995
char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes);
29942996
Th_Trace("[render_eval] => %h {%#h}<br>\n",
2995
- Th_ReturnCodeName(rc, 0), nTrRes, zTrRes);
2997
+ Th_ReturnCodeName(rc, 0), TH1_LEN(nTrRes), zTrRes);
29962998
}
29972999
if( rc!=TH_OK ) break;
29983000
z += i;
29993001
if( z[0] ){ z += 6; }
30003002
i = 0;
30013003
--- src/th_main.c
+++ src/th_main.c
@@ -2049,11 +2049,11 @@
2049 res = Th_Eval(interp, 0, argv[2], TH1_LEN(argl[2]));
2050 if( g.thTrace ){
2051 int nTrRes;
2052 char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes);
2053 Th_Trace("[query_eval] => %h {%#h}<br>\n",
2054 Th_ReturnCodeName(res, 0), nTrRes, zTrRes);
2055 }
2056 if( res==TH_BREAK || res==TH_CONTINUE ) res = TH_OK;
2057 }
2058 rc = sqlite3_finalize(pStmt);
2059 if( rc!=SQLITE_OK ){
@@ -2763,10 +2763,11 @@
2763 char *zResult = (char*)Th_GetResult(g.interp, &nResult);
2764 /*
2765 ** Make sure that the TH1 script error was not caused by a "missing"
2766 ** command hook handler as that is not actually an error condition.
2767 */
 
2768 if( memcmp(zResult, NO_COMMAND_HOOK_ERROR, nResult)!=0 ){
2769 sendError(0,zResult, nResult, 0);
2770 }else{
2771 /*
2772 ** There is no command hook handler "installed". This situation
@@ -2850,10 +2851,11 @@
2850 char *zResult = (char*)Th_GetResult(g.interp, &nResult);
2851 /*
2852 ** Make sure that the TH1 script error was not caused by a "missing"
2853 ** webpage hook handler as that is not actually an error condition.
2854 */
 
2855 if( memcmp(zResult, NO_WEBPAGE_HOOK_ERROR, nResult)!=0 ){
2856 sendError(0,zResult, nResult, 1);
2857 }else{
2858 /*
2859 ** There is no webpage hook handler "installed". This situation
@@ -2990,11 +2992,11 @@
2990 rc = Th_Eval(g.interp, 0, (const char*)z, i);
2991 if( g.thTrace ){
2992 int nTrRes;
2993 char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes);
2994 Th_Trace("[render_eval] => %h {%#h}<br>\n",
2995 Th_ReturnCodeName(rc, 0), nTrRes, zTrRes);
2996 }
2997 if( rc!=TH_OK ) break;
2998 z += i;
2999 if( z[0] ){ z += 6; }
3000 i = 0;
3001
--- src/th_main.c
+++ src/th_main.c
@@ -2049,11 +2049,11 @@
2049 res = Th_Eval(interp, 0, argv[2], TH1_LEN(argl[2]));
2050 if( g.thTrace ){
2051 int nTrRes;
2052 char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes);
2053 Th_Trace("[query_eval] => %h {%#h}<br>\n",
2054 Th_ReturnCodeName(res, 0), TH1_LEN(nTrRes), zTrRes);
2055 }
2056 if( res==TH_BREAK || res==TH_CONTINUE ) res = TH_OK;
2057 }
2058 rc = sqlite3_finalize(pStmt);
2059 if( rc!=SQLITE_OK ){
@@ -2763,10 +2763,11 @@
2763 char *zResult = (char*)Th_GetResult(g.interp, &nResult);
2764 /*
2765 ** Make sure that the TH1 script error was not caused by a "missing"
2766 ** command hook handler as that is not actually an error condition.
2767 */
2768 nResult = TH1_LEN(nResult);
2769 if( memcmp(zResult, NO_COMMAND_HOOK_ERROR, nResult)!=0 ){
2770 sendError(0,zResult, nResult, 0);
2771 }else{
2772 /*
2773 ** There is no command hook handler "installed". This situation
@@ -2850,10 +2851,11 @@
2851 char *zResult = (char*)Th_GetResult(g.interp, &nResult);
2852 /*
2853 ** Make sure that the TH1 script error was not caused by a "missing"
2854 ** webpage hook handler as that is not actually an error condition.
2855 */
2856 nResult = TH1_LEN(nResult);
2857 if( memcmp(zResult, NO_WEBPAGE_HOOK_ERROR, nResult)!=0 ){
2858 sendError(0,zResult, nResult, 1);
2859 }else{
2860 /*
2861 ** There is no webpage hook handler "installed". This situation
@@ -2990,11 +2992,11 @@
2992 rc = Th_Eval(g.interp, 0, (const char*)z, i);
2993 if( g.thTrace ){
2994 int nTrRes;
2995 char *zTrRes = (char*)Th_GetResult(g.interp, &nTrRes);
2996 Th_Trace("[render_eval] => %h {%#h}<br>\n",
2997 Th_ReturnCodeName(rc, 0), TH1_LEN(nTrRes), zTrRes);
2998 }
2999 if( rc!=TH_OK ) break;
3000 z += i;
3001 if( z[0] ){ z += 6; }
3002 i = 0;
3003
+2 -2
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -782,11 +782,11 @@
782782
return TCL_ERROR;
783783
}
784784
arg = Tcl_GetStringFromObj(objv[1], &nArg);
785785
rc = Th_Eval(th1Interp, 0, arg, nArg);
786786
arg = Th_GetResult(th1Interp, &nArg);
787
- Tcl_SetObjResult(interp, Tcl_NewStringObj(arg, nArg));
787
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(arg, TH1_LEN(nArg)));
788788
return getTclReturnCode(rc);
789789
}
790790
791791
/*
792792
** Tcl command: th1Expr arg
@@ -815,11 +815,11 @@
815815
return TCL_ERROR;
816816
}
817817
arg = Tcl_GetStringFromObj(objv[1], &nArg);
818818
rc = Th_Expr(th1Interp, arg, nArg);
819819
arg = Th_GetResult(th1Interp, &nArg);
820
- Tcl_SetObjResult(interp, Tcl_NewStringObj(arg, nArg));
820
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(arg, TH1_LEN(nArg)));
821821
return getTclReturnCode(rc);
822822
}
823823
824824
/*
825825
** Array of Tcl integration commands. Used when adding or removing the Tcl
826826
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -782,11 +782,11 @@
782 return TCL_ERROR;
783 }
784 arg = Tcl_GetStringFromObj(objv[1], &nArg);
785 rc = Th_Eval(th1Interp, 0, arg, nArg);
786 arg = Th_GetResult(th1Interp, &nArg);
787 Tcl_SetObjResult(interp, Tcl_NewStringObj(arg, nArg));
788 return getTclReturnCode(rc);
789 }
790
791 /*
792 ** Tcl command: th1Expr arg
@@ -815,11 +815,11 @@
815 return TCL_ERROR;
816 }
817 arg = Tcl_GetStringFromObj(objv[1], &nArg);
818 rc = Th_Expr(th1Interp, arg, nArg);
819 arg = Th_GetResult(th1Interp, &nArg);
820 Tcl_SetObjResult(interp, Tcl_NewStringObj(arg, nArg));
821 return getTclReturnCode(rc);
822 }
823
824 /*
825 ** Array of Tcl integration commands. Used when adding or removing the Tcl
826
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -782,11 +782,11 @@
782 return TCL_ERROR;
783 }
784 arg = Tcl_GetStringFromObj(objv[1], &nArg);
785 rc = Th_Eval(th1Interp, 0, arg, nArg);
786 arg = Th_GetResult(th1Interp, &nArg);
787 Tcl_SetObjResult(interp, Tcl_NewStringObj(arg, TH1_LEN(nArg)));
788 return getTclReturnCode(rc);
789 }
790
791 /*
792 ** Tcl command: th1Expr arg
@@ -815,11 +815,11 @@
815 return TCL_ERROR;
816 }
817 arg = Tcl_GetStringFromObj(objv[1], &nArg);
818 rc = Th_Expr(th1Interp, arg, nArg);
819 arg = Th_GetResult(th1Interp, &nArg);
820 Tcl_SetObjResult(interp, Tcl_NewStringObj(arg, TH1_LEN(nArg)));
821 return getTclReturnCode(rc);
822 }
823
824 /*
825 ** Array of Tcl integration commands. Used when adding or removing the Tcl
826

Keyboard Shortcuts

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