Tcl Source Code

Check-in [c96de4ed64]
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:Bug [a47641a031]. TclJoinPath was calling TclNewFSPathObj with a first argument that was not an absolute path. Added a check for that. Fixes Windows test failures fileSystem-1.{3,4}
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-6-branch
Files: files | file ages | folders
SHA1: c96de4ed64b76406e3631f8136977efa4722f55d
User & Date: ashok 2016-07-08 07:58:00
References
2016-07-08
08:08 Ticket [3611365fff] filesystem-1.3 and filesystem-1.4 fail status still Open with 3 other changes artifact: b4712d85f6 user: apnadkarni
08:08 Ticket [3075027fff] 8.5 head testsuite failures on windows status still Open with 7 other changes artifact: bc04ef1c30 user: apnadkarni
Context
2016-07-08
14:19
Repair some memory corruption problems in EnsembleCmdRep. check-in: 65348900a8 user: dgp tags: core-8-6-branch
10:30
Merge core-8-6-branch: Bug [a47641a031]. TclJoinPath was calling TclNewFSPathObj with a first argume... check-in: 4589a9d17c user: jan.nijtmans tags: trunk
07:58
Bug [a47641a031]. TclJoinPath was calling TclNewFSPathObj with a first argument that was not an abso... check-in: c96de4ed64 user: ashok tags: core-8-6-branch
2016-07-07
06:30
Bugfix [5d7ea04580]. Treat .cmd and .ps1 files are executable on Windows. check-in: b697ecad74 user: ashok tags: core-8-6-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclPathObj.c.

865
866
867
868
869
870
871



872
873
874
875
876

877
878
879
880
881
882
883
884
	/*
	 * This is a special case where we can be much more efficient, where
	 * we are joining a single relative path onto an object that is
	 * already of path type. The 'TclNewFSPathObj' call below creates an
	 * object which can be normalized more efficiently. Currently we only
	 * use the special case when we have exactly two elements, but we
	 * could expand that in the future.



	 */

	if ((i == (elements-2)) && (i == 0)
		&& (elt->typePtr == &tclFsPathType)
		&& !((elt->bytes != NULL) && (elt->bytes[0] == '\0'))) {

	    Tcl_Obj *tailObj = objv[i+1];

	    type = TclGetPathType(tailObj, NULL, NULL, NULL);
	    if (type == TCL_PATH_RELATIVE) {
		const char *str;
		int len;

		str = Tcl_GetStringFromObj(tailObj, &len);






>
>
>



|
|
>
|







865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
	/*
	 * This is a special case where we can be much more efficient, where
	 * we are joining a single relative path onto an object that is
	 * already of path type. The 'TclNewFSPathObj' call below creates an
	 * object which can be normalized more efficiently. Currently we only
	 * use the special case when we have exactly two elements, but we
	 * could expand that in the future.
         *
         * Bugfix [a47641a0]. TclNewFSPathObj requires first argument
         * to be an absolute path. Added a check for that elt is absolute.
	 */

	if ((i == (elements-2)) && (i == 0)
                && (elt->typePtr == &tclFsPathType)
		&& !((elt->bytes != NULL) && (elt->bytes[0] == '\0'))
                && TclGetPathType(elt, NULL, NULL, NULL) == TCL_PATH_ABSOLUTE) {
            Tcl_Obj *tailObj = objv[i+1];

	    type = TclGetPathType(tailObj, NULL, NULL, NULL);
	    if (type == TCL_PATH_RELATIVE) {
		const char *str;
		int len;

		str = Tcl_GetStringFromObj(tailObj, &len);