summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2008-10-11 06:55:03 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2008-10-11 06:55:03 (GMT)
commit4291e971289f53f2ff70d9ac0f24816b095b7b7a (patch)
treed401a72b3c9af3a033d4db7b739c5ca4cdb4aa00
parentf25a2adf90a5124554bc13c318038337cc7ecf6b (diff)
downloadtk-4291e971289f53f2ff70d9ac0f24816b095b7b7a.zip
tk-4291e971289f53f2ff70d9ac0f24816b095b7b7a.tar.gz
tk-4291e971289f53f2ff70d9ac0f24816b095b7b7a.tar.bz2
Correct error result generation of [$canvas select clear $bogus].
-rw-r--r--ChangeLog4
-rw-r--r--generic/tkCanvas.c4
-rw-r--r--tests/canvText.test5
3 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 3da7d67..09d7f7d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-10-11 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tkCanvas.c (CanvasWidgetCmd): Corrected result generation.
+
2008-10-10 Don Porter <dgp@users.sourceforge.net>
*** 8.5.5 TAGGED FOR RELEASE ***
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 5872d55..ca48d87 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCanvas.c,v 1.46.2.1 2008/04/17 14:52:24 dgp Exp $
+ * RCS: @(#) $Id: tkCanvas.c,v 1.46.2.2 2008/10/11 06:55:03 dkf Exp $
*/
/* #define USE_OLD_TAG_SEARCH 1 */
@@ -1630,7 +1630,7 @@ CanvasWidgetCmd(
break;
case CANV_CLEAR:
if (objc != 3) {
- Tcl_AppendResult(interp, 3, objv, NULL);
+ Tcl_WrongNumArgs(interp, 3, objv, NULL);
result = TCL_ERROR;
goto done;
}
diff --git a/tests/canvText.test b/tests/canvText.test
index 615bf15..5db53c8 100644
--- a/tests/canvText.test
+++ b/tests/canvText.test
@@ -6,7 +6,7 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: canvText.test,v 1.16.4.1 2008/10/09 15:17:44 dgp Exp $
+# RCS: @(#) $Id: canvText.test,v 1.16.4.2 2008/10/11 06:55:03 dkf Exp $
package require tcltest 2.1
eval tcltest::configure $argv
@@ -458,6 +458,9 @@ test canvText-14.4 {GetTextIndex procedure: select error} {
test canvText-14.5 {GetTextIndex procedure: bad int or unknown index} {
list [catch {.c index test xyz} msg] $msg
} {1 {bad index "xyz"}}
+test canvText-14.6 {select clear errors} -body {
+ .c select clear test
+} -returnCodes error -result "wrong \# args: should be \".c select clear\""
test canvText-15.1 {SetTextCursor procedure} {
.c itemconfig -text "abcdefg"