X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fuxplink.c;h=6290a2c2a713b7adb2a4bd7fc1debd99591ae058;hb=a063e522970946bf7d5dc052079d7773c0dee76d;hp=3bcec398b60d13627ef6e7d58b813796728f346d;hpb=f3685eb9482ab98e7c7ecee06970795a016834b6;p=PuTTY.git diff --git a/unix/uxplink.c b/unix/uxplink.c index 3bcec398..6290a2c2 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -119,8 +119,6 @@ char *platform_default_s(const char *name) { if (!strcmp(name, "TermType")) return dupstr(getenv("TERM")); - if (!strcmp(name, "UserName")) - return get_username(); if (!strcmp(name, "SerialLine")) return dupstr("/dev/ttyS0"); return NULL; @@ -882,6 +880,18 @@ int main(int argc, char **argv) */ cmdline_run_saved(conf); + /* + * If we have no better ideas for the remote username, use the local + * one, as 'ssh' does. + */ + if (conf_get_str(conf, CONF_username)[0] == '\0') { + char *user = get_username(); + if (user) { + conf_set_str(conf, CONF_username, user); + sfree(user); + } + } + /* * Apply subsystem status. */