connection_open = 1;
static void do_cmd(char *host, char *user, char *cmd){    char *err, *realhost;    if (host == NULL || host[0] == '\0')	bump("Empty host name");    /* Try to load settings for this host */    do_defaults(host, &cfg);    if (cfg.host[0] == '\0') {	/* No settings for this host; use defaults */        do_defaults(NULL, &cfg);	strncpy(cfg.host, host, sizeof(cfg.host)-1);	cfg.host[sizeof(cfg.host)-1] = '\0';	cfg.port = 22;    }    /* Set username */    if (user != NULL && user[0] != '\0') {	strncpy(cfg.username, user, sizeof(cfg.username)-1);	cfg.username[sizeof(cfg.username)-1] = '\0';    } else if (cfg.username[0] == '\0') {	bump("Empty user name");    }    if (cfg.protocol != PROT_SSH)	cfg.port = 22;    if (portnumber)	cfg.port = portnumber;    strncpy(cfg.remote_cmd, cmd, sizeof(cfg.remote_cmd));    cfg.remote_cmd[sizeof(cfg.remote_cmd)-1] = '\0';    cfg.nopty = TRUE;    back = &ssh_backend;    err = back->init(cfg.host, cfg.port, &realhost);    if (err != NULL)	bump("ssh_init: %s", err);    ssh_scp_init();    if (verbose && realhost != NULL)	tell_user(stderr, "Connected to %s\n", realhost);    connection_open = 1;}