mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 18:04:25 +09: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':
|
case 'r':
|
||||||
x = strdup(session->username);
|
x = strdup(session->username);
|
||||||
break;
|
break;
|
||||||
|
case 'p':
|
||||||
|
if (session->port < 65536) {
|
||||||
|
char tmp[6];
|
||||||
|
|
||||||
|
snprintf(tmp, sizeof(tmp), "%u", session->port);
|
||||||
|
x = strdup(tmp);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ssh_set_error(session, SSH_FATAL,
|
ssh_set_error(session, SSH_FATAL,
|
||||||
"Wrong escape sequence detected");
|
"Wrong escape sequence detected");
|
||||||
|
|||||||
Reference in New Issue
Block a user