summaryrefslogtreecommitdiffstats
path: root/generic/tkSelect.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2008-10-05 18:22:21 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2008-10-05 18:22:21 (GMT)
commit501d0b1523e4a2b370c58cd262bbed99725a5ab1 (patch)
tree57b5f8cd5ff8ef866da62495bc435946f4655c50 /generic/tkSelect.c
parent291d618cfb6ad5e935244599abbf1bdb93a284fc (diff)
downloadtk-501d0b1523e4a2b370c58cd262bbed99725a5ab1.zip
tk-501d0b1523e4a2b370c58cd262bbed99725a5ab1.tar.gz
tk-501d0b1523e4a2b370c58cd262bbed99725a5ab1.tar.bz2
Greatly clean up Tk's handling of the writability of the Tcl result object.
Diffstat (limited to 'generic/tkSelect.c')
-rw-r--r--generic/tkSelect.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/generic/tkSelect.c b/generic/tkSelect.c
index 7c42e60..7f3f9df 100644
--- a/generic/tkSelect.c
+++ b/generic/tkSelect.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkSelect.c,v 1.22 2008/07/23 23:24:21 nijtmans Exp $
+ * RCS: @(#) $Id: tkSelect.c,v 1.23 2008/10/05 18:22:21 dkf Exp $
*/
#include "tkInt.h"
@@ -1331,7 +1331,6 @@ HandleTclCommand(
char *command, *string;
Tcl_Interp *interp = cmdInfoPtr->interp;
Tcl_DString oldResult;
- Tcl_Obj *objPtr;
int extraBytes, charOffset, count, numChars;
const char *p;
@@ -1384,8 +1383,7 @@ HandleTclCommand(
Tcl_DStringInit(&oldResult);
Tcl_DStringGetResult(interp, &oldResult);
if (TkCopyAndGlobalEval(interp, command) == TCL_OK) {
- objPtr = Tcl_GetObjResult(interp);
- string = Tcl_GetStringFromObj(objPtr, &length);
+ string = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &length);
count = (length > maxBytes) ? maxBytes : length;
memcpy(buffer, string, (size_t) count);
buffer[count] = '\0';