diff options
Diffstat (limited to 'generic/tclTest.c')
| -rw-r--r-- | generic/tclTest.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c index 9f63d06..590b0c8 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -2057,6 +2057,9 @@ static int UtfExtWrapper( {"stoponerror", TCL_ENCODING_STOPONERROR}, {"noterminate", TCL_ENCODING_NO_TERMINATE}, {"charlimit", TCL_ENCODING_CHAR_LIMIT}, + {"profiletcl8", TCL_ENCODING_PROFILE_TCL8}, + {"profilestrict", TCL_ENCODING_PROFILE_STRICT}, + {"profilereplace", TCL_ENCODING_PROFILE_REPLACE}, {NULL, 0} }; int i; @@ -2133,24 +2136,22 @@ static int UtfExtWrapper( } bufLen = dstLen + 4; /* 4 -> overflow detection */ - bufPtr = (unsigned char *)Tcl_Alloc(bufLen); + bufPtr = (unsigned char *) Tcl_Alloc(bufLen); memset(bufPtr, 0xFF, dstLen); /* Need to check nul terminator */ memmove(bufPtr + dstLen, "\xAB\xCD\xEF\xAB", 4); /* overflow detection */ bytes = Tcl_GetByteArrayFromObj(objv[3], &srcLen); /* Last! to avoid shimmering */ - result = (*transformer)(interp, encoding, (const char *) bytes, srcLen, flags, + result = (*transformer)(interp, encoding, (const char *)bytes, srcLen, flags, encStatePtr, (char *) bufPtr, dstLen, - srcReadVar ? &srcRead : NULL, - &dstWrote, - dstCharsVar ? &dstChars : NULL); + srcReadVar ? &srcRead : NULL, + &dstWrote, + dstCharsVar ? &dstChars : NULL); if (memcmp(bufPtr + bufLen - 4, "\xAB\xCD\xEF\xAB", 4)) { Tcl_SetResult(interp, "Tcl_ExternalToUtf wrote past output buffer", TCL_STATIC); result = TCL_ERROR; } else if (result != TCL_ERROR) { - Tcl_Obj *resultObjs[3]; - switch (result) { case TCL_OK: resultObjs[0] = Tcl_NewStringObj("ok", -1); @@ -2209,7 +2210,6 @@ static int UtfExtWrapper( Tcl_FreeEncoding(encoding); /* Free returned reference */ return result; } - /* *---------------------------------------------------------------------- @@ -2313,7 +2313,6 @@ TestencodingObjCmd( Tcl_NewIntObj(Tcl_GetEncodingNulLength(encoding))); Tcl_FreeEncoding(encoding); break; - case ENC_EXTTOUTF: return UtfExtWrapper(interp,Tcl_ExternalToUtf,objc,objv); case ENC_UTFTOEXT: |
