diff options
author | Dave Davenport <qball@gmpclient.org> | 2019-03-08 13:46:10 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2019-03-08 13:46:10 +0100 |
commit | beeb9c8b2775d2f6f6d4b8649a52101a2ffe0b2e (patch) | |
tree | d06555a098c81ca3cbe40b63509e9536f1821efe /source | |
parent | 2728e4ad23b4f076f8ed13426ab7974403213d33 (diff) |
[SSH] Use \x1F as separator between host/command and port.
Fixes: #932
Diffstat (limited to 'source')
-rw-r--r-- | source/dialogs/ssh.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/dialogs/ssh.c b/source/dialogs/ssh.c index df17f6e9..4bf2e3f1 100644 --- a/source/dialogs/ssh.c +++ b/source/dialogs/ssh.c @@ -139,7 +139,7 @@ static void exec_ssh ( const SshEntry *entry ) char *path = g_build_filename ( cache_dir, SSH_CACHE_FILE, NULL ); // TODO update. if ( entry->port > 0 ) { - char *store = g_strdup_printf("%s:%d", entry->hostname, entry->port ); + char *store = g_strdup_printf("%s\x1F%d", entry->hostname, entry->port ); history_set ( path, store ); g_free ( store ); } else { @@ -205,7 +205,7 @@ static SshEntry *read_known_hosts_file ( const char *path, SshEntry * retv, unsi if ( start[0] == '[' ) { start++; char *end = strchr ( start, ']'); - if ( end[1] == ':' ){ + if ( end[1] == '\x1F' ){ *end = '\0'; port = atoi ( &(end[2]) ); } @@ -457,7 +457,7 @@ static SshEntry * get_ssh ( SSHModePrivateData *pd, unsigned int *length ) retv = malloc ( (*length)*sizeof(SshEntry)); for ( unsigned int i = 0; i < (*length); i++ ){ int port = 0; - char *portstr = strchr ( h[i], ':' ); + char *portstr = strchr ( h[i], '\x1F' ); if ( portstr != NULL ) { *portstr = '\0'; port = atoi ( &(portstr[1]) ); |