diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-30 09:08:25 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-30 09:08:25 (GMT) |
commit | 0bd347649db35a0b43e0a0ba3d443d4f1f9b3d2b (patch) | |
tree | 031f1c2df728052af4573ff7ea91cadf69634adf /generic/tkTextIndex.c | |
parent | ca5623894dd113cd5642189574cf6c104c64cad8 (diff) | |
download | tk-0bd347649db35a0b43e0a0ba3d443d4f1f9b3d2b.zip tk-0bd347649db35a0b43e0a0ba3d443d4f1f9b3d2b.tar.gz tk-0bd347649db35a0b43e0a0ba3d443d4f1f9b3d2b.tar.bz2 |
more auditing of error codes
Diffstat (limited to 'generic/tkTextIndex.c')
-rw-r--r-- | generic/tkTextIndex.c | 9 |
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(©); return TCL_ERROR; } |