diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-11 11:48:38 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-11 11:48:38 (GMT) |
commit | cfce00e636e389f48c32d61c5483a913a0a9d656 (patch) | |
tree | c9a801ef36f2cf95b58dcb55dd72e10ecfe02f67 | |
parent | 6b32cafc8e54ed1a7bee854a77191c18186d905e (diff) | |
parent | fa87897c16b0dc6d903c1be0dc80389d9cd072e3 (diff) | |
download | tk-cfce00e636e389f48c32d61c5483a913a0a9d656.zip tk-cfce00e636e389f48c32d61c5483a913a0a9d656.tar.gz tk-cfce00e636e389f48c32d61c5483a913a0a9d656.tar.bz2 |
Eliminate all usage of deprecated Tcl_EvalObj, Tcl_GlobalEval and Tcl_GlobalEvalObj functions.
Add [file normalize] to pkgIndex.tcl, in order to prevent '..' in file paths.
-rw-r--r-- | generic/tkBind.c | 2 | ||||
-rw-r--r-- | generic/tkConsole.c | 13 | ||||
-rw-r--r-- | generic/tkMain.c | 2 | ||||
-rw-r--r-- | generic/tkTextWind.c | 4 | ||||
-rw-r--r-- | generic/tkWindow.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkTheme.c | 2 | ||||
-rw-r--r-- | macosx/tkMacOSXHLEvents.c | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 2 | ||||
-rw-r--r-- | unix/Makefile.in | 8 | ||||
-rw-r--r-- | unix/tkUnixSend.c | 6 | ||||
-rw-r--r-- | unix/tkUnixWm.c | 2 | ||||
-rw-r--r-- | win/Makefile.in | 6 | ||||
-rw-r--r-- | win/tkWinScrlbr.c | 2 | ||||
-rw-r--r-- | win/tkWinWm.c | 2 |
14 files changed, 32 insertions, 31 deletions
diff --git a/generic/tkBind.c b/generic/tkBind.c index 7126e24..d5294fc 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -2297,7 +2297,7 @@ ChangeScreen( int code; Tcl_IncrRefCount(cmdObj); - code = Tcl_GlobalEvalObj(interp, cmdObj); + code = Tcl_EvalObjEx(interp, cmdObj, TCL_EVAL_GLOBAL); if (code != TCL_OK) { Tcl_AddErrorInfo(interp, "\n (changing screen in event binding)"); diff --git a/generic/tkConsole.c b/generic/tkConsole.c index 434350a..eb67fa4 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -224,7 +224,7 @@ Tk_InitConsoleChannels( * only an issue when Tk is loaded dynamically. */ - if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { + if (Tcl_InitStubs(interp, "8.6", 0) == NULL) { return; } @@ -439,7 +439,8 @@ Tk_CreateConsoleWindow( } Tcl_Preserve(consoleInterp); - result = Tcl_GlobalEval(consoleInterp, "source $tk_library/console.tcl"); + result = Tcl_EvalEx(consoleInterp, "source $tk_library/console.tcl", + -1, TCL_EVAL_GLOBAL); if (result == TCL_ERROR) { Tcl_SetReturnOptions(interp, Tcl_GetReturnOptions(consoleInterp, result)); @@ -531,7 +532,7 @@ ConsoleOutput( Tcl_DStringFree(&ds); Tcl_IncrRefCount(cmd); - Tcl_GlobalEvalObj(consoleInterp, cmd); + Tcl_EvalObjEx(consoleInterp, cmd, TCL_EVAL_GLOBAL); Tcl_DecrRefCount(cmd); } } @@ -741,7 +742,7 @@ ConsoleObjCmd( Tcl_IncrRefCount(cmd); if (consoleInterp && !Tcl_InterpDeleted(consoleInterp)) { Tcl_Preserve(consoleInterp); - result = Tcl_GlobalEvalObj(consoleInterp, cmd); + result = Tcl_EvalObjEx(consoleInterp, cmd, TCL_EVAL_GLOBAL); Tcl_SetReturnOptions(interp, Tcl_GetReturnOptions(consoleInterp, result)); Tcl_SetObjResult(interp, Tcl_GetObjResult(consoleInterp)); @@ -807,7 +808,7 @@ InterpreterObjCmd( Tcl_Preserve(otherInterp); switch ((enum option) index) { case OTHER_EVAL: - result = Tcl_GlobalEvalObj(otherInterp, objv[2]); + result = Tcl_EvalObjEx(otherInterp, objv[2], TCL_EVAL_GLOBAL); /* * TODO: Should exceptions be filtered here? @@ -946,7 +947,7 @@ ConsoleEventProc( Tcl_Interp *consoleInterp = info->consoleInterp; if (consoleInterp && !Tcl_InterpDeleted(consoleInterp)) { - Tcl_GlobalEval(consoleInterp, "tk::ConsoleExit"); + Tcl_EvalEx(consoleInterp, "tk::ConsoleExit", -1, TCL_EVAL_GLOBAL); } if (--info->refCount <= 0) { diff --git a/generic/tkMain.c b/generic/tkMain.c index 706f444..4d532df 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -188,7 +188,7 @@ Tk_MainEx( * only an issue when Tk is loaded dynamically. */ - if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { + if (Tcl_InitStubs(interp, "8.6", 0) == NULL) { abort(); } diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index 454d198..f258ec7 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -911,10 +911,10 @@ EmbWinLayoutProc( if (dsPtr != NULL) { Tcl_DStringAppend(dsPtr, before, (int) (string-before)); - code = Tcl_GlobalEval(textPtr->interp, Tcl_DStringValue(dsPtr)); + code = Tcl_EvalEx(textPtr->interp, Tcl_DStringValue(dsPtr), -1, TCL_EVAL_GLOBAL); Tcl_DStringFree(dsPtr); } else { - code = Tcl_GlobalEval(textPtr->interp, ewPtr->body.ew.create); + code = Tcl_EvalEx(textPtr->interp, ewPtr->body.ew.create, -1, TCL_EVAL_GLOBAL); } if (code != TCL_OK) { Tcl_BackgroundException(textPtr->interp, code); diff --git a/generic/tkWindow.c b/generic/tkWindow.c index f4138b2..f5131a8 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -3051,7 +3051,7 @@ Initialize( * only an issue when Tk is loaded dynamically. */ - if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { + if (Tcl_InitStubs(interp, "8.6", 0) == NULL) { return TCL_ERROR; } @@ -3287,7 +3287,7 @@ Initialize( geometry = NULL; } - if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL) { + if (Tcl_PkgRequire(interp, "Tcl", "8.6", 0) == NULL) { code = TCL_ERROR; goto done; } diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 5097abc..6c2cab0 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -508,7 +508,7 @@ static void ThemeChangedProc(ClientData clientData) static char ThemeChangedScript[] = "ttk::ThemeChanged"; StylePackageData *pkgPtr = clientData; - if (Tcl_GlobalEval(pkgPtr->interp, ThemeChangedScript) != TCL_OK) { + if (Tcl_EvalEx(pkgPtr->interp, ThemeChangedScript, -1, TCL_EVAL_GLOBAL) != TCL_OK) { Tcl_BackgroundError(pkgPtr->interp); } pkgPtr->themeChangePending = 0; diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index 362f752..b5e8f43 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -222,7 +222,7 @@ OappHandler( if (interp && Tcl_GetCommandInfo(interp, "::tk::mac::OpenApplication", &dummy)){ - int code = Tcl_GlobalEval(interp, "::tk::mac::OpenApplication"); + int code = Tcl_EvalEx(interp, "::tk::mac::OpenApplication", -1, TCL_EVAL_GLOBAL); if (code != TCL_OK) { Tcl_BackgroundException(interp, code); } @@ -259,7 +259,7 @@ RappHandler( if (interp && Tcl_GetCommandInfo(interp, "::tk::mac::ReopenApplication", &dummy)) { - int code = Tcl_GlobalEval(interp, "::tk::mac::ReopenApplication"); + int code = Tcl_EvalEx(interp, "::tk::mac::ReopenApplication", -1, TCL_EVAL_GLOBAL); if (code != TCL_OK){ Tcl_BackgroundException(interp, code); } @@ -295,7 +295,7 @@ PrefsHandler( if (interp && Tcl_GetCommandInfo(interp, "::tk::mac::ShowPreferences", &dummy)){ - int code = Tcl_GlobalEval(interp, "::tk::mac::ShowPreferences"); + int code = Tcl_EvalEx(interp, "::tk::mac::ShowPreferences", -1, TCL_EVAL_GLOBAL); if (code != TCL_OK) { Tcl_BackgroundException(interp, code); } @@ -625,7 +625,7 @@ ReallyKillMe( Tcl_Interp *interp = ((KillEvent *) eventPtr)->interp; Tcl_CmdInfo dummy; int quit = Tcl_GetCommandInfo(interp, "::tk::mac::Quit", &dummy); - int code = Tcl_GlobalEval(interp, quit ? "::tk::mac::Quit" : "exit"); + int code = Tcl_EvalEx(interp, quit ? "::tk::mac::Quit" : "exit", -1, TCL_EVAL_GLOBAL); if (code != TCL_OK) { /* diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index f8a0d3b..c14c6eb 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -701,7 +701,7 @@ TkWmProtocolEventProc( Tcl_Preserve(protPtr); interp = protPtr->interp; Tcl_Preserve(interp); - result = Tcl_GlobalEval(interp, protPtr->command); + result = Tcl_EvalEx(interp, protPtr->command, -1, TCL_EVAL_GLOBAL); if (result != TCL_OK) { Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( "\n (command for \"%s\" window manager protocol)", diff --git a/unix/Makefile.in b/unix/Makefile.in index 1df6721..2179ab9 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -728,16 +728,16 @@ install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) ${WISH_EXE} echo "Creating package index $(PKG_INDEX)"; \ rm -f "$(PKG_INDEX)"; \ (\ - echo "if {[catch {package present Tcl $(TCLVERSION)$(TCLPATCHL)}]} return";\ + echo "if {[catch {package present Tcl 8.6.0}]} return";\ relative=`echo | awk '{ORS=" "; split("$(TK_PKG_DIR)",a,"/"); for (f in a) {print ".."}}'`;\ if test "x$(DLL_INSTALL_DIR)" != "x$(BIN_INSTALL_DIR)"; then \ - echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}$(TK_LIB_FILE)] Tk]";\ + echo "package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir $${relative}$(TK_LIB_FILE)]] Tk]";\ else \ echo "if {(\$$::tcl_platform(platform) eq \"unix\") && ([info exists ::env(DISPLAY)]";\ echo " || ([info exists ::argv] && (\"-display\" in \$$::argv)))} {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)] Tk]";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir $${relative}.. bin $(TK_LIB_FILE)]] Tk]";\ echo "} else {";\ - echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll] Tk]";\ + echo " package ifneeded Tk $(MAJOR_VERSION).$(MINOR_VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir $${relative}.. bin tk${MAJOR_VERSION}${MINOR_VERSION}.dll]] Tk]";\ echo "}";\ fi \ ) > "$(PKG_INDEX)"; \ diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index e3a810d..15817eb 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -1024,7 +1024,7 @@ Tk_SendCmd( localInterp = riPtr->interp; Tcl_Preserve(localInterp); if (firstArg == (argc-1)) { - result = Tcl_GlobalEval(localInterp, argv[firstArg]); + result = Tcl_EvalEx(localInterp, argv[firstArg], -1, TCL_EVAL_GLOBAL); } else { Tcl_DStringInit(&request); Tcl_DStringAppend(&request, argv[firstArg], -1); @@ -1032,7 +1032,7 @@ Tk_SendCmd( Tcl_DStringAppend(&request, " ", 1); Tcl_DStringAppend(&request, argv[i], -1); } - result = Tcl_GlobalEval(localInterp, Tcl_DStringValue(&request)); + result = Tcl_EvalEx(localInterp, Tcl_DStringValue(&request), -1, TCL_EVAL_GLOBAL); Tcl_DStringFree(&request); } if (interp != localInterp) { @@ -1565,7 +1565,7 @@ SendEventProc( remoteInterp = riPtr->interp; Tcl_Preserve(remoteInterp); - result = Tcl_GlobalEval(remoteInterp, script); + result = Tcl_EvalEx(remoteInterp, script, -1, TCL_EVAL_GLOBAL); /* * The call to Tcl_Release may have released the interpreter which diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index eb183bd..1ae8602 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -6275,7 +6275,7 @@ TkWmProtocolEventProc( Tcl_Preserve(protPtr); interp = protPtr->interp; Tcl_Preserve(interp); - result = Tcl_GlobalEval(interp, protPtr->command); + result = Tcl_EvalEx(interp, protPtr->command, -1, TCL_EVAL_GLOBAL); if (result != TCL_OK) { Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( "\n (command for \"%s\" window manager protocol)", diff --git a/win/Makefile.in b/win/Makefile.in index 787dc30..5c45112 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -486,12 +486,12 @@ install-binaries: binaries @echo "Creating package index $(PKG_INDEX)"; @$(RM) $(PKG_INDEX); @(\ - echo "if {[catch {package present Tcl $(TCLVERSION)$(TCLPATCHL)}]} return";\ + echo "if {[catch {package present Tcl 8.6.0}]} return";\ echo "if {(\$$::tcl_platform(platform) eq \"unix\") && ([info exists ::env(DISPLAY)]";\ echo " || ([info exists ::argv] && (\"-display\" in \$$::argv)))} {";\ - echo " package ifneeded Tk $(VERSION)$(PATCH_LEVEL) [list load [file join \$$dir .. .. bin libtk$(VERSION).dll] Tk]";\ + echo " package ifneeded Tk $(VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir .. .. bin libtk$(VERSION).dll]] Tk]";\ echo "} else {";\ - echo " package ifneeded Tk $(VERSION)$(PATCH_LEVEL) [list load [file join \$$dir .. .. bin $(TK_DLL_FILE)] Tk]";\ + echo " package ifneeded Tk $(VERSION)$(PATCH_LEVEL) [list load [file normalize [file join \$$dir .. .. bin $(TK_DLL_FILE)]] Tk]";\ echo "}";\ ) > $(PKG_INDEX); @for i in tkConfig.sh $(TK_LIB_FILE) $(TK_STUB_LIB_FILE); \ diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index 1fd5e13..a280626 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -552,7 +552,7 @@ ScrollbarProc( } interp = scrollPtr->info.interp; - code = Tcl_GlobalEval(interp, cmdString.string); + code = Tcl_EvalEx(interp, cmdString.string, -1, TCL_EVAL_GLOBAL); if (code != TCL_OK && code != TCL_CONTINUE && code != TCL_BREAK) { Tcl_AddErrorInfo(interp, "\n (scrollbar command)"); Tcl_BackgroundException(interp, code); diff --git a/win/tkWinWm.c b/win/tkWinWm.c index dc5d4d9..040a712 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -6615,7 +6615,7 @@ TkWmProtocolEventProc( Tcl_Preserve(protPtr); interp = protPtr->interp; Tcl_Preserve(interp); - result = Tcl_GlobalEval(interp, protPtr->command); + result = Tcl_EvalEx(interp, protPtr->command, -1, TCL_EVAL_GLOBAL); if (result != TCL_OK) { Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( "\n (command for \"%s\" window manager protocol)", |