Tcl Source Code

Check-in [f8304cc503]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Addition of a cast in tclWinFile.c to match types in a comparison, and fix of a TRACE string literal in tclExecute.c with a bogus escape. Both would otherwise bug a Windows debug build (where warnings are errors).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f8304cc50370d746d8a5deec1e7cddeef37ad7aa
User & Date: andreask 2014-08-01 20:07:40
Context
2014-08-02
13:04
TIP 429 Implementation: [string cat] check-in: 9ce779b099 user: ferrieux tags: tip-429
04:36
Another Preserve/Release on channels is needed during IO finalization. check-in: c286356bd3 user: dgp tags: trunk
2014-08-01
20:07
Addition of a cast in tclWinFile.c to match types in a comparison, and fix of a TRACE string literal... check-in: f8304cc503 user: andreask tags: trunk
19:50
Updated package "platform" to version 1.0.13. Separated the identifiers "macosx*-i386-x86_64" and "... check-in: 8e0d1b1eca user: andreask tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclExecute.c.

5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
	/*
	 * Pop the list and get the index.
	 */

	valuePtr = OBJ_AT_TOS;
	opnd = TclGetInt4AtPtr(pc+1);
	TRACE(("\%.30s\" %d => ", O2S(valuePtr), opnd));

	/*
	 * Get the contents of the list, making sure that it really is a list
	 * in the process.
	 */

	if (TclListObjGetElements(interp, valuePtr, &objc, &objv) != TCL_OK) {






|







5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
	/*
	 * Pop the list and get the index.
	 */

	valuePtr = OBJ_AT_TOS;
	opnd = TclGetInt4AtPtr(pc+1);
	TRACE(("\"%.30s\" %d => ", O2S(valuePtr), opnd));

	/*
	 * Get the contents of the list, making sure that it really is a list
	 * in the process.
	 */

	if (TclListObjGetElements(interp, valuePtr, &objc, &objv) != TCL_OK) {

Changes to win/tclWinFile.c.

2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
	}
	Tcl_IncrRefCount(validPathPtr);
    }

    str = Tcl_GetString(validPathPtr);
    len = validPathPtr->length;

    if (strlen(str)!=len) {
	/* String contains NUL-bytes. This is invalid. */
	return 0;
    }
    /* Let MultiByteToWideChar check for other invalid sequences, like
     * 0xC0 0x80 (== overlong NUL). See bug [3118489]: NUL in filenames */
    len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, 0, 0);
    if (len==0) {






|







2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
	}
	Tcl_IncrRefCount(validPathPtr);
    }

    str = Tcl_GetString(validPathPtr);
    len = validPathPtr->length;

    if (strlen(str)!=(unsigned int)len) {
	/* String contains NUL-bytes. This is invalid. */
	return 0;
    }
    /* Let MultiByteToWideChar check for other invalid sequences, like
     * 0xC0 0x80 (== overlong NUL). See bug [3118489]: NUL in filenames */
    len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, str, -1, 0, 0);
    if (len==0) {