mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-04-08 18:35:05 +02:00
add backslash support for Windows paths
This commit is contained in:
parent
a915f06c78
commit
ef4fcdd43e
9
misc.c
9
misc.c
@ -1261,6 +1261,15 @@ tilde_expand(const char *filename, uid_t uid, char **retp)
|
||||
path = NULL; /* ~/ */
|
||||
else
|
||||
path = copy; /* ~/path */
|
||||
#ifdef WINDOWS
|
||||
// also need to account for backward slashes on Windows
|
||||
} else if (*copy == '\\') {
|
||||
copy += strspn(copy, "\\");
|
||||
if (*copy == '\0')
|
||||
path = NULL; /* ~\ */
|
||||
else
|
||||
path = copy; /* ~\path */
|
||||
#endif /* WINDOWS */
|
||||
} else {
|
||||
user = copy;
|
||||
if ((path = strchr(copy, '/')) != NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user