summaryrefslogtreecommitdiffstats
path: root/generic/tkTextIndex.c
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2012-07-30 09:08:25 (GMT)
committerdkf <dkf@noemail.net>2012-07-30 09:08:25 (GMT)
commitf6cd9146176b69fed2601313e2c7b30447b1aac4 (patch)
tree031f1c2df728052af4573ff7ea91cadf69634adf /generic/tkTextIndex.c
parent2112a76a64dc50c4e3dd1605bbf24cc0336c9987 (diff)
downloadtk-f6cd9146176b69fed2601313e2c7b30447b1aac4.zip
tk-f6cd9146176b69fed2601313e2c7b30447b1aac4.tar.gz
tk-f6cd9146176b69fed2601313e2c7b30447b1aac4.tar.bz2
more auditing of error codes
FossilOrigin-Name: aae315a30f0b4367d59525a21dfb5139c4440a36
Diffstat (limited to 'generic/tkTextIndex.c')
-rw-r--r--generic/tkTextIndex.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index b04eef2..25888d8 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -832,15 +832,14 @@ GetIndex(
if (!TkBTreeCharTagged(&first, tagPtr) && !TkBTreeNextTag(&search)) {
if (tagPtr == textPtr->selTagPtr) {
tagName = "sel";
- } else {
- if (hPtr != NULL) {
- tagName = Tcl_GetHashKey(&sharedPtr->tagTable, hPtr);
- }
+ } else if (hPtr != NULL) {
+ tagName = Tcl_GetHashKey(&sharedPtr->tagTable, hPtr);
}
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"text doesn't contain any characters tagged with \"%s\"",
tagName));
- Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_INDEX", NULL);
+ Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_INDEX", tagName,
+ NULL);
Tcl_DStringFree(&copy);
return TCL_ERROR;
}