Expands a leading ~ to the current user's home directory.
The function expands only ~ and paths that start with ~/ (or the native
separator). It does not expand ~user, environment variables, or a ~ in
the middle of a path. If no home directory is available, it returns the
input unchanged.
Expands a leading
~to the current user's home directory.The function expands only
~and paths that start with~/(or the native separator). It does not expand~user, environment variables, or a~in the middle of a path. If no home directory is available, it returns the input unchanged.