summaryrefslogtreecommitdiffstats
path: root/generic/tclPathObj.c
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2022-08-01 17:07:54 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2022-08-01 17:07:54 (GMT)
commit7754129cabaa2aa7f6a487106c0551d0c5f2c2d3 (patch)
treec9596e5a21332d0595b316f8a390bd290a9d2867 /generic/tclPathObj.c
parent515f8ab0440b2d4cb6411790c2c08210cadfee6a (diff)
downloadtcl-7754129cabaa2aa7f6a487106c0551d0c5f2c2d3.zip
tcl-7754129cabaa2aa7f6a487106c0551d0c5f2c2d3.tar.gz
tcl-7754129cabaa2aa7f6a487106c0551d0c5f2c2d3.tar.bz2
Update tests for TIP 602
Diffstat (limited to 'generic/tclPathObj.c')
-rw-r--r--generic/tclPathObj.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index d9fccb7..c123613 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -2631,6 +2631,32 @@ TclGetHomeDir(
/*
*----------------------------------------------------------------------
*
+ * TclGetHomeDirObj --
+ *
+ * Wrapper around TclGetHomeDir. See that function.
+ *
+ * Results:
+ * Returns a Tcl_Obj containing the home directory of a user
+ * or NULL on failure with error message in interp if non-NULL.
+ *
+ *----------------------------------------------------------------------
+ */
+Tcl_Obj *
+TclGetHomeDirObj(
+ Tcl_Interp *interp, /* May be NULL. Only used for error messages */
+ const char *user) /* User name. NULL -> current user */
+{
+ Tcl_DString dirString;
+
+ if (TclGetHomeDir(interp, user, &dirString) != TCL_OK) {
+ return NULL;
+ }
+ return TclDStringToObj(&dirString);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TclResolveTildePath --
*
* If the passed path is begins with a tilde, does tilde resolution