return dupstr(getenv("TERM"));
if (!strcmp(name, "UserName"))
return get_username();
+ if (!strcmp(name, "SerialLine"))
+ return dupstr("/dev/ttyS0");
return NULL;
}
errors = 1;
}
} else if (*p) {
- if (!*cfg.host) {
+ if (!cfg_launchable(&cfg)) {
char *q = p;
/*
{
Config cfg2;
do_defaults(host, &cfg2);
- if (loaded_session || cfg2.host[0] == '\0') {
+ if (loaded_session || !cfg_launchable(&cfg2)) {
/* No settings for this host; use defaults */
/* (or session was already loaded with -load) */
strncpy(cfg.host, host, sizeof(cfg.host) - 1);
if (errors)
return 1;
- if (!*cfg.host) {
+ if (!cfg_launchable(&cfg)) {
usage();
}
cfg.host[p1] = '\0';
}
- if (!cfg.remote_cmd_ptr && !*cfg.remote_cmd)
+ if (!cfg.remote_cmd_ptr && !*cfg.remote_cmd && !*cfg.ssh_nc_host)
flags |= FLAG_INTERACTIVE;
/*
FD_SET_MAX(signalpipe[0], maxfd, rset);
if (connopen && !sending &&
- back->socket(backhandle) != NULL &&
+ back->connected(backhandle) &&
back->sendok(backhandle) &&
back->sendbuffer(backhandle) < MAX_STDIN_BACKLOG) {
/* If we're OK to send, then try to read from stdin. */
char buf[4096];
int ret;
- if (connopen && back->socket(backhandle) != NULL) {
+ if (connopen && back->connected(backhandle)) {
ret = read(0, buf, sizeof(buf));
if (ret < 0) {
perror("stdin: read");
try_output(1);
}
- if ((!connopen || back->socket(backhandle) == NULL) &&
+ if ((!connopen || !back->connected(backhandle)) &&
bufchain_size(&stdout_data) == 0 &&
bufchain_size(&stderr_data) == 0)
break; /* we closed the connection */