diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2012-07-30 09:08:25 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2012-07-30 09:08:25 (GMT) |
commit | 11f61544529c3da346ec22c04082f611a6848db5 (patch) | |
tree | 3df05098022fc5df53dd08bafb10f26ced4f36e7 /generic/tkTextIndex.c | |
parent | 27f0a32c4c776d3b53f2ab234aef1e7bcc69a0b1 (diff) | |
download | tk-11f61544529c3da346ec22c04082f611a6848db5.zip tk-11f61544529c3da346ec22c04082f611a6848db5.tar.gz tk-11f61544529c3da346ec22c04082f611a6848db5.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; } |