Fossil SCM

Have the TH1 combobox command fail with a script error when its TEXT-LIST argument is not a well-formed list, instead of using the unset results of Th_SplitList().

dmestas 2026-11-21 21:38 UTC small-fixes
Commit 6bcb3a6c4557f7f8d12cd830d971e088b99556fa1208c89fb3dab940c77681e2
1 file changed +4 -1
+4 -1
--- src/th_main.c
+++ src/th_main.c
@@ -1132,11 +1132,14 @@
11321132
int *aszElem;
11331133
char **azElem;
11341134
int i;
11351135
11361136
if( Th_ToInt(interp, argv[3], argl[3], &height) ) return TH_ERROR;
1137
- Th_SplitList(interp, argv[2], TH1_LEN(argl[2]), &azElem, &aszElem, &nElem);
1137
+ if( Th_SplitList(interp, argv[2], TH1_LEN(argl[2]),
1138
+ &azElem, &aszElem, &nElem) ){
1139
+ return TH_ERROR;
1140
+ }
11381141
blob_init(&name, (char*)argv[1], TH1_LEN(argl[1]));
11391142
zValue = Th_Fetch(blob_str(&name), &nValue);
11401143
nValue = TH1_LEN(nValue);
11411144
zH = htmlize(blob_buffer(&name), blob_size(&name));
11421145
z = mprintf("<select id=\"%s\" name=\"%s\" size=\"%d\">", zH, zH, height);
11431146
--- src/th_main.c
+++ src/th_main.c
@@ -1132,11 +1132,14 @@
1132 int *aszElem;
1133 char **azElem;
1134 int i;
1135
1136 if( Th_ToInt(interp, argv[3], argl[3], &height) ) return TH_ERROR;
1137 Th_SplitList(interp, argv[2], TH1_LEN(argl[2]), &azElem, &aszElem, &nElem);
 
 
 
1138 blob_init(&name, (char*)argv[1], TH1_LEN(argl[1]));
1139 zValue = Th_Fetch(blob_str(&name), &nValue);
1140 nValue = TH1_LEN(nValue);
1141 zH = htmlize(blob_buffer(&name), blob_size(&name));
1142 z = mprintf("<select id=\"%s\" name=\"%s\" size=\"%d\">", zH, zH, height);
1143
--- src/th_main.c
+++ src/th_main.c
@@ -1132,11 +1132,14 @@
1132 int *aszElem;
1133 char **azElem;
1134 int i;
1135
1136 if( Th_ToInt(interp, argv[3], argl[3], &height) ) return TH_ERROR;
1137 if( Th_SplitList(interp, argv[2], TH1_LEN(argl[2]),
1138 &azElem, &aszElem, &nElem) ){
1139 return TH_ERROR;
1140 }
1141 blob_init(&name, (char*)argv[1], TH1_LEN(argl[1]));
1142 zValue = Th_Fetch(blob_str(&name), &nValue);
1143 nValue = TH1_LEN(nValue);
1144 zH = htmlize(blob_buffer(&name), blob_size(&name));
1145 z = mprintf("<select id=\"%s\" name=\"%s\" size=\"%d\">", zH, zH, height);
1146

Keyboard Shortcuts

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