diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-28 19:59:10 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-06-28 19:59:10 (GMT) |
commit | eca033cfb854b6950a21b858085a58d0f9002860 (patch) | |
tree | c177b306cc7eabdede0019b7baa94421273e2a89 /generic/tclCmdAH.c | |
parent | a9f64ab24b5965c3bf6f65e0de8b8706fc38ec7c (diff) | |
parent | 3275986a1aad85bc313bd0c5ce901b5124dc61de (diff) | |
download | tcl-eca033cfb854b6950a21b858085a58d0f9002860.zip tcl-eca033cfb854b6950a21b858085a58d0f9002860.tar.gz tcl-eca033cfb854b6950a21b858085a58d0f9002860.tar.bz2 |
merge trunk
bug fix: variable $key not found
make it work on cygwin as well
Diffstat (limited to 'generic/tclCmdAH.c')
-rw-r--r-- | generic/tclCmdAH.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index e1ec927..8e32389 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -505,7 +505,7 @@ Tcl_EncodingObjCmd( break; } case ENC_DIRS: - return EncodingDirsObjCmd(dummy, interp, objc-1, objv+1); + return EncodingDirsObjCmd(dummy, interp, objc, objv); case ENC_NAMES: if (objc > 2) { Tcl_WrongNumArgs(interp, 2, objv, NULL); @@ -552,20 +552,24 @@ EncodingDirsObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { - if (objc > 2) { - Tcl_WrongNumArgs(interp, 1, objv, "?dirList?"); + Tcl_Obj *dirListObj; + + if (objc > 3) { + Tcl_WrongNumArgs(interp, 2, objv, "?dirList?"); return TCL_ERROR; } - if (objc == 1) { + if (objc == 2) { Tcl_SetObjResult(interp, Tcl_GetEncodingSearchPath()); return TCL_OK; } - if (Tcl_SetEncodingSearchPath(objv[1]) == TCL_ERROR) { + + dirListObj = objv[2]; + if (Tcl_SetEncodingSearchPath(dirListObj) == TCL_ERROR) { Tcl_AppendResult(interp, "expected directory list but got \"", - TclGetString(objv[1]), "\"", NULL); + TclGetString(dirListObj), "\"", NULL); return TCL_ERROR; } - Tcl_SetObjResult(interp, objv[1]); + Tcl_SetObjResult(interp, dirListObj); return TCL_OK; } |