]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/winplink.c
Stop sending release events for mouse wheel 'buttons' in X mouse mode.
[PuTTY.git] / windows / winplink.c
index a618c7eddd60e36fe64f538695d709dcfcca89ae..451eff3b8907d3ed98445c0ced3a8a954b6e0dbd 100644 (file)
@@ -57,10 +57,6 @@ void nonfatal(char *p, ...)
     vfprintf(stderr, p, ap);
     va_end(ap);
     fputc('\n', stderr);
-    if (logctx) {
-        log_free(logctx);
-        logctx = NULL;
-    }
 }
 void connection_fatal(void *frontend, char *p, ...)
 {
@@ -292,6 +288,9 @@ void stdouterr_sent(struct handle *h, int new_backlog)
     }
 }
 
+const int share_can_be_downstream = TRUE;
+const int share_can_be_upstream = TRUE;
+
 int main(int argc, char **argv)
 {
     int sending;
@@ -383,8 +382,7 @@ int main(int argc, char **argv)
                        q += 2;
                    conf_set_int(conf, CONF_protocol, PROT_TELNET);
                    p = q;
-                   while (*p && *p != ':' && *p != '/')
-                       p++;
+                    p += host_strcspn(p, ":/");
                    c = *p;
                    if (*p)
                        *p++ = '\0';
@@ -522,10 +520,21 @@ int main(int argc, char **argv)
            }
        }
 
-       /*
-        * Trim off a colon suffix if it's there.
-        */
-       host[strcspn(host, ":")] = '\0';
+        /*
+         * Trim a colon suffix off the hostname if it's there. In
+         * order to protect unbracketed IPv6 address literals
+         * against this treatment, we do not do this if there's
+         * _more_ than one colon.
+         */
+        {
+            char *c = host_strchr(host, ':');
+            if (c) {
+                char *d = host_strchr(c+1, ':');
+                if (!d)
+                    *c = '\0';
+            }
+        }
 
        /*
         * Remove any remaining whitespace.