diff options
author | dgp <dgp@noemail.net> | 2003-09-17 23:45:34 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2003-09-17 23:45:34 (GMT) |
commit | 457873e3a96be5d61739b4d11b4578dd1048bb15 (patch) | |
tree | 83f58673700c439ea545d6c2466e88abef0aad12 /generic | |
parent | b318e2fef43f19f55d943d2ec15b0d6c1bc126e0 (diff) | |
download | tk-457873e3a96be5d61739b4d11b4578dd1048bb15.zip tk-457873e3a96be5d61739b4d11b4578dd1048bb15.tar.gz tk-457873e3a96be5d61739b4d11b4578dd1048bb15.tar.bz2 |
* generic/tkImage.c: Stopped [image create] from generating an
* tests/image.test: image command name that would overwrite an
existing command name. Thanks to Michael Schlenker. [Bug 808039].
FossilOrigin-Name: 3023c17eaf943a887e0b043c7e6094ced7177168
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkImage.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/generic/tkImage.c b/generic/tkImage.c index a27a446..476662b 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkImage.c,v 1.21 2003/07/07 09:35:58 dkf Exp $ + * RCS: @(#) $Id: tkImage.c,v 1.22 2003/09/17 23:45:35 dgp Exp $ */ #include "tkInt.h" @@ -233,9 +233,12 @@ Tk_ImageObjCmd(clientData, interp, objc, objv) */ if ((objc == 3) || (*(arg = Tcl_GetString(objv[3])) == '-')) { - dispPtr->imageId++; - sprintf(idString, "image%d", dispPtr->imageId); - name = idString; + Tcl_CmdInfo dummy; + do { + dispPtr->imageId++; + sprintf(idString, "image%d", dispPtr->imageId); + name = idString; + } while (Tcl_GetCommandInfo(interp, name, &dummy) != 0); firstOption = 3; } else { TkWindow *topWin; |