aboutsummaryrefslogtreecommitdiff
path: root/lib/ssh.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ssh.c')
-rw-r--r--lib/ssh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index cb743eb41..1cc4bcd4c 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -422,9 +422,9 @@ static CURLcode ssh_getworkingpath(struct connectdata *conn,
free(working_path);
return CURLE_OUT_OF_MEMORY;
}
- if((working_path_len > 1) && (working_path[1] == '~'))
- /* It is referenced to the home directory, so strip the leading '/' */
- memcpy(real_path, working_path+1, 1 + working_path_len-1);
+ if((working_path_len > 3) && (!memcmp(working_path, "/~/", 3)))
+ /* It is referenced to the home directory, so strip the leading '/~/' */
+ memcpy(real_path, working_path+3, 4 + working_path_len-3);
else
memcpy(real_path, working_path, 1 + working_path_len);
}