diff options
| author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-23 11:04:00 +0000 |
|---|---|---|
| committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-04-23 11:04:00 +0000 |
| commit | 98ab2177fd26ccf2eb8a12fcb9d708635c44535e (patch) | |
| tree | 149ae6204620b940c861474292ceeaef4f7bb17f /ext/tk | |
| parent | 908dabfb5466b8dc52aa853155c3f4f0c943f281 (diff) | |
| download | ruby-98ab2177fd26ccf2eb8a12fcb9d708635c44535e.tar.gz ruby-98ab2177fd26ccf2eb8a12fcb9d708635c44535e.tar.xz ruby-98ab2177fd26ccf2eb8a12fcb9d708635c44535e.zip | |
* ext/tcltklib/tcltklib.c (ip_RubyExitCommand): exit with status code
via TclTkIp#_eval didn't work. [ruby-talk:139390]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@8379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/tk')
| -rw-r--r-- | ext/tk/tcltklib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/tk/tcltklib.c b/ext/tk/tcltklib.c index e93fc04cc..67a9b7538 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 |
