]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Oops. The new remote_cmd_ptr points in the wrong place when you copy a
authorSimon Tatham <anakin@pobox.com>
Wed, 28 Mar 2001 16:38:40 +0000 (16:38 +0000)
committerSimon Tatham <anakin@pobox.com>
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 :-/ )

[originally from svn r1025]

plink.c

diff --git a/plink.c b/plink.c
index 76ed437ca218b060ece14cbd8eef818b20e15ace..ebe5bcc98f52133968a83e21c91b72418c11370e 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);