summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2022-07-08 04:06:35 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2022-07-08 04:06:35 (GMT)
commit9336a020ee8538c5927e9cbe8cbad80ef915c741 (patch)
treef6b493abe07003f4e3c9fdb896f599c7667a2753 /generic/tclIOUtil.c
parentaa59356ae9e1626385a69af39d3e7c060a53c4c4 (diff)
downloadtcl-9336a020ee8538c5927e9cbe8cbad80ef915c741.zip
tcl-9336a020ee8538c5927e9cbe8cbad80ef915c741.tar.gz
tcl-9336a020ee8538c5927e9cbe8cbad80ef915c741.tar.bz2
Start on TIP-602 implementation. Work in progress
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r--generic/tclIOUtil.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index d51491f..50346b6 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -1215,7 +1215,7 @@ FsAddMountsToGlobResult(
* (4) The mapping from a string representation of a file to a full,
* normalized pathname changes. For example, if 'env(HOME)' is modified,
* then any pathname containing '~' maps to a different item, possibly in
- * a different filesystem.
+ * a different filesystem. (Only if TCL_TILDE_EXPAND is defined)
*
* Tcl has no control over (2) and (3), so each registered filesystem must
* call Tcl_FSMountsChnaged in each of those circumstances.
@@ -3939,13 +3939,17 @@ Tcl_FSSplitPath(
if (length > 0) {
Tcl_Obj *nextElt;
- if (elementStart[0] == '~') {
+#ifdef TCL_TILDE_EXPAND
+ if (elementStart[0] == '~') {
TclNewLiteralStringObj(nextElt, "./");
Tcl_AppendToObj(nextElt, elementStart, length);
} else {
nextElt = Tcl_NewStringObj(elementStart, length);
}
- Tcl_ListObjAppendElement(NULL, result, nextElt);
+#else
+ nextElt = Tcl_NewStringObj(elementStart, length);
+#endif /* TCL_TILDE_EXPAND */
+ Tcl_ListObjAppendElement(NULL, result, nextElt);
}
if (*p++ == '\0') {
break;