aboutsummaryrefslogtreecommitdiffstats
path: root/ext/tk/tcltklib.c
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-23 11:04:00 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-04-23 11:04:00 +0000
commit4e9a14b715815cec855ab19432581a5a80fc6a1c (patch)
tree149ae6204620b940c861474292ceeaef4f7bb17f /ext/tk/tcltklib.c
parenta08123a5de4cc29bb956a3812e54e3fec9b59648 (diff)
downloadruby-4e9a14b715815cec855ab19432581a5a80fc6a1c.tar.gz
* ext/tcltklib/tcltklib.c (ip_RubyExitCommand): exit with status code
via TclTkIp#_eval didn't work. [ruby-talk:139390] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk/tcltklib.c')
-rw-r--r--ext/tk/tcltklib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c
index e93fc04cc9..67a9b75383 100644
--- a/ext/tk/tcltklib.c
+++ b/ext/tk/tcltklib.c
@@ -2860,16 +2860,17 @@ ip_RubyExitCommand(clientData, interp, argc, argv)
case 2:
#if TCL_MAJOR_VERSION >= 8
- if (!Tcl_GetIntFromObj(interp, argv[1], &state)) {
+ if (Tcl_GetIntFromObj(interp, argv[1], &state) == TCL_ERROR) {
return TCL_ERROR;
}
param = Tcl_GetString(argv[1]);
#else /* TCL_MAJOR_VERSION < 8 */
state = (int)strtol(argv[1], &endptr, 0);
- if (endptr) {
+ if (*endptr) {
Tcl_AppendResult(interp,
"expected integer but got \"",
argv[1], "\"", (char *)NULL);
+ return TCL_ERROR;
}
param = argv[1];
#endif