X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fuxplink.c;h=851cefdaeb234ec8929bc765e3c76b3bbb2789ce;hb=8316deb3399fe1d0c406132cf2e795a76de26b64;hp=fdc0f666eac7f728ad332a15f77ca02f70b104d1;hpb=6daf6faede46bd8aa3a39cbe59d34c987b2ea114;p=PuTTY.git diff --git a/unix/uxplink.c b/unix/uxplink.c index fdc0f666..851cefda 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -13,6 +13,7 @@ #include #include #include +#include #define PUTTY_DO_GLOBALS /* actually _define_ globals */ #include "putty.h" @@ -128,10 +129,15 @@ void ldisc_update(void *frontend, int echo, int edit) else mode.c_lflag &= ~ECHO; - if (edit) + if (edit) { + mode.c_iflag |= ICRNL; mode.c_lflag |= ISIG | ICANON; - else + } else { + mode.c_iflag &= ~ICRNL; mode.c_lflag &= ~(ISIG | ICANON); + mode.c_cc[VMIN] = 1; + mode.c_cc[VTIME] = 0; + } tcsetattr(0, TCSANOW, &mode); } @@ -213,7 +219,6 @@ static void usage(void) printf(" force use of a particular protocol\n"); printf(" -P port connect to specified port\n"); printf(" -l user connect with specified username\n"); - printf(" -m file read remote command(s) from file\n"); printf(" -batch disable all interactive prompts\n"); printf("The following options only apply to SSH connections:\n"); printf(" -pw passw login with specified password\n"); @@ -230,6 +235,7 @@ static void usage(void) printf(" -4 -6 force use of IPv4 or IPv6\n"); printf(" -C enable compression\n"); printf(" -i key private key file for authentication\n"); + printf(" -m file read remote command(s) from file\n"); printf(" -s remote command is an SSH subsystem (SSH-2 only)\n"); printf(" -N don't start a shell/command (SSH-2 only)\n"); exit(1); @@ -410,8 +416,6 @@ int main(int argc, char **argv) cfg.port = default_port; } else { cfg = cfg2; - /* Ick: patch up internal pointer after copy */ - cfg.remote_cmd_ptr = cfg.remote_cmd; } } @@ -514,7 +518,7 @@ int main(int argc, char **argv) cfg.host[p1] = '\0'; } - if (!*cfg.remote_cmd_ptr) + if (!cfg.remote_cmd_ptr && !*cfg.remote_cmd) flags |= FLAG_INTERACTIVE; /*