1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00
Files
winscp/source/putty/utils/default_description.c
Martin Prikryl 6c8cf9ae8d Updating code to PuTTY 0.77
Source commit: da47a0c8a6347ce05fd02167b644c05cef61dc28
2022-02-07 09:57:39 +01:00

23 lines
816 B
C

/*
* Construct a description string for a backend to use as
* backend_description(), or a plug as plug_description().
*
* For some backends this will be overridden: e.g. SSH prefers to
* think in terms of _logical_ host names (i.e. the one associated
* with the host key) rather than the physical details of where you're
* connecting to. But this default is good for simpler backends.
*/
#include "putty.h"
char *default_description(const BackendVtable *backvt,
const char *host, int port)
{
const char *be_name = backvt->displayname_lc;
if (backvt->default_port && port == backvt->default_port)
return dupprintf("%s connection to %s", be_name, host);
else
return dupprintf("%s connection to %s port %d", be_name, host, port);
}