Tcl Source Code

Check-in [ec32e3cc76]
Login

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

Overview
Comment:3559678 Fix bad filename normalization when the last component is the empty string.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ec32e3cc76966c930283da0612b164fb2de969d2
User & Date: dgp 2012-08-20 23:50:44
Context
2012-08-23
12:11
[Bug 3496014] Unecessary memset() in Tcl_SetByteArrayObj(). check-in: f61c86cef1 user: jan.nijtmans tags: trunk
2012-08-21
16:35
merge trunk check-in: ce5a28a6c4 user: dgp tags: core-8-6-b3-rc
08:07
unnecessary hook struct definitions Closed-Leaf check-in: e787083b2f user: jan.nijtmans tags: jn-no-struct-names
2012-08-20
23:50
3559678 Fix bad filename normalization when the last component is the empty string. check-in: ec32e3cc76 user: dgp tags: trunk
23:45
3559678 Fix bad filename normalization when the last component is the empty string. check-in: 0b332ef62e user: dgp tags: core-8-5-branch
09:12
Remove wrapper macro for ntohs(): unnecessary, because it doesn't require an initialized winsock_2 l... check-in: 46096ee96a user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.






1
2
3
4
5
6
7





2012-08-20  Jan Nijtmans  <[email protected]>

	* win/tclWinPort.h:  Remove wrapper macro for ntohs(): unnecessary,
	because it doesn't require an initialized winsock_2 library. See:
	<http://msdn.microsoft.com/en-us/library/windows/desktop/ms740075%28v=vs.85%29.aspx>
	* win/tclWinSock.c
	* generic/tclStubInit.c
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2012-08-20  Don Porter  <[email protected]>

	* generic/tclPathObj.c:	[Bug 3559678] Fix bad filename normalization
	when the last component is the empty string.

2012-08-20  Jan Nijtmans  <[email protected]>

	* win/tclWinPort.h:  Remove wrapper macro for ntohs(): unnecessary,
	because it doesn't require an initialized winsock_2 library. See:
	<http://msdn.microsoft.com/en-us/library/windows/desktop/ms740075%28v=vs.85%29.aspx>
	* win/tclWinSock.c
	* generic/tclStubInit.c

Changes to generic/tclPathObj.c.

1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778


1779



1780
1781
1782
1783
1784
1785
1786
    if (PATHFLAGS(pathPtr) != 0) {
	/*
	 * This is a special path object which is the result of something like
	 * 'file join'
	 */

	Tcl_Obj *dir, *copy;
	int cwdLen, pathType;

	pathType = Tcl_FSGetPathType(fsPathPtr->cwdPtr);
	dir = Tcl_FSGetNormalizedPath(interp, fsPathPtr->cwdPtr);
	if (dir == NULL) {
	    return NULL;
	}
	/* TODO: Figure out why this is needed. */
	if (pathPtr->bytes == NULL) {
	    UpdateStringOfFsPath(pathPtr);
	}



	copy = AppendPath(dir, fsPathPtr->normPathPtr);



	Tcl_IncrRefCount(dir);
	Tcl_IncrRefCount(copy);

	/*
	 * We now own a reference on both 'dir' and 'copy'
	 */








|











>
>
|
>
>
>







1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
    if (PATHFLAGS(pathPtr) != 0) {
	/*
	 * This is a special path object which is the result of something like
	 * 'file join'
	 */

	Tcl_Obj *dir, *copy;
	int tailLen, cwdLen, pathType;

	pathType = Tcl_FSGetPathType(fsPathPtr->cwdPtr);
	dir = Tcl_FSGetNormalizedPath(interp, fsPathPtr->cwdPtr);
	if (dir == NULL) {
	    return NULL;
	}
	/* TODO: Figure out why this is needed. */
	if (pathPtr->bytes == NULL) {
	    UpdateStringOfFsPath(pathPtr);
	}

	Tcl_GetStringFromObj(fsPathPtr->normPathPtr, &tailLen);
	if (tailLen) {
	    copy = AppendPath(dir, fsPathPtr->normPathPtr);
	} else {
	    copy = Tcl_DuplicateObj(dir);
	}
	Tcl_IncrRefCount(dir);
	Tcl_IncrRefCount(copy);

	/*
	 * We now own a reference on both 'dir' and 'copy'
	 */