summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixTest.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2014-07-18 12:22:17 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2014-07-18 12:22:17 (GMT)
commit7f40dea1efc31fc14c832405c46361bc49a52ea7 (patch)
tree4c6ec4a0b70f45eb7ced1f0ab91ac0d7940f53e9 /unix/tclUnixTest.c
parent4e7d04385e3894b881f8be44e2c25dc2931ac896 (diff)
parent1bd8f407a5fc44a8b7a54bb78d8d29a2e5b0358f (diff)
downloadtcl-dkf_http_cookies.zip
tcl-dkf_http_cookies.tar.gz
tcl-dkf_http_cookies.tar.bz2
merge trunkdkf_http_cookies
Diffstat (limited to 'unix/tclUnixTest.c')
-rw-r--r--unix/tclUnixTest.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c
index 4b0f369..c5ac52a 100644
--- a/unix/tclUnixTest.c
+++ b/unix/tclUnixTest.c
@@ -63,7 +63,7 @@ static const char *gotsig = "0";
*/
static Tcl_CmdProc TestalarmCmd;
-static Tcl_CmdProc TestchmodCmd;
+static Tcl_ObjCmdProc TestchmodCmd;
static Tcl_CmdProc TestfilehandlerCmd;
static Tcl_CmdProc TestfilewaitCmd;
static Tcl_CmdProc TestfindexecutableCmd;
@@ -96,7 +96,7 @@ int
TclplatformtestInit(
Tcl_Interp *interp) /* Interpreter to add commands to. */
{
- Tcl_CreateCommand(interp, "testchmod", TestchmodCmd,
+ Tcl_CreateObjCommand(interp, "testchmod", TestchmodCmd,
NULL, NULL);
Tcl_CreateCommand(interp, "testfilehandler", TestfilehandlerCmd,
NULL, NULL);
@@ -740,29 +740,25 @@ static int
TestchmodCmd(
ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
- int argc, /* Number of arguments. */
- const char **argv) /* Argument strings. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *const *objv) /* Argument strings. */
{
int i, mode;
- char *rest;
- if (argc < 2) {
- usage:
- Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
- " mode file ?file ...?", NULL);
+ if (objc < 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "mode file ?file ...?");
return TCL_ERROR;
}
- mode = (int) strtol(argv[1], &rest, 8);
- if ((rest == argv[1]) || (*rest != '\0')) {
- goto usage;
+ if (Tcl_GetIntFromObj(interp, objv[1], &mode) != TCL_OK) {
+ return TCL_ERROR;
}
- for (i = 2; i < argc; i++) {
+ for (i = 2; i < objc; i++) {
Tcl_DString buffer;
const char *translated;
- translated = Tcl_TranslateFileName(interp, argv[i], &buffer);
+ translated = Tcl_TranslateFileName(interp, Tcl_GetString(objv[i]), &buffer);
if (translated == NULL) {
return TCL_ERROR;
}