mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
misc: Added %p for port to ssh_path_expand_escape().
This commit is contained in:
@@ -644,6 +644,14 @@ char *ssh_path_expand_escape(ssh_session session, const char *s) {
|
||||
case 'r':
|
||||
x = strdup(session->username);
|
||||
break;
|
||||
case 'p':
|
||||
if (session->port < 65536) {
|
||||
char tmp[6];
|
||||
|
||||
snprintf(tmp, sizeof(tmp), "%u", session->port);
|
||||
x = strdup(tmp);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ssh_set_error(session, SSH_FATAL,
|
||||
"Wrong escape sequence detected");
|
||||
|
||||
Reference in New Issue
Block a user