Oops. The new remote_cmd_ptr points in the wrong place when you copy a
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 28 Mar 2001 16:38:40 +0000 (16:38 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 28 Mar 2001 16:38:40 +0000 (16:38 +0000)
Config structure like plink does at one point. (I'm almost tempted to
say this is where a copy constructor would be handy :-/ )

git-svn-id: svn://svn.tartarus.org/sgt/putty@1025 cda61777-01e9-0310-a592-d414129be87e

plink.c

diff --git a/plink.c b/plink.c
index 76ed437..ebe5bcc 100644 (file)
--- a/plink.c
+++ b/plink.c
@@ -423,8 +423,10 @@ int main(int argc, char **argv) {
                             strncpy(cfg.host, p, sizeof(cfg.host)-1);
                             cfg.host[sizeof(cfg.host)-1] = '\0';
                             cfg.port = default_port;
-                        } else
+                        } else {
                             cfg = cfg2;
+                            cfg.remote_cmd_ptr = cfg.remote_cmd;
+                        }
                     } else {
                         *r++ = '\0';
                         strncpy(cfg.username, p, sizeof(cfg.username)-1);