X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fuxplink.c;h=3e32925cd4e182cf54baa1d0a7397bce415adcf7;hb=954df095f4ec3ca98c225e89f737f17477695785;hp=4f991ba88551252e51c2f0067d98ecfcf43c933e;hpb=5904545cc18289541702da284b00490cb25a753e;p=PuTTY.git diff --git a/unix/uxplink.c b/unix/uxplink.c index 4f991ba8..3e32925c 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; @@ -883,6 +881,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. */