diff options
author | dgp@users.sourceforge.net <dgp> | 2003-09-17 23:45:05 (GMT) |
---|---|---|
committer | dgp@users.sourceforge.net <dgp> | 2003-09-17 23:45:05 (GMT) |
commit | 2c32956f58485c71cbf9d27e0fa47a321211b1c7 (patch) | |
tree | 8c012bdb25f7fdb644aaa9ff6419a25fb5ed77e4 /generic | |
parent | cc776c5caaba9e9d74b8572b3e22c4982e56b57a (diff) | |
download | tk-2c32956f58485c71cbf9d27e0fa47a321211b1c7.zip tk-2c32956f58485c71cbf9d27e0fa47a321211b1c7.tar.gz tk-2c32956f58485c71cbf9d27e0fa47a321211b1c7.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].
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 78e2a56..d813c96 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.19.2.1 2003/07/07 09:43:01 dkf Exp $ + * RCS: @(#) $Id: tkImage.c,v 1.19.2.2 2003/09/17 23:45:05 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; |