X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/f89c329410c18fe1f09d843747fad77babb9f89c..954d5c5a66596eb50a379e81c20372e922aa89a5:/windows/window.c diff --git a/windows/window.c b/windows/window.c index 68ba61f7..17aaf1ae 100644 --- a/windows/window.c +++ b/windows/window.c @@ -542,9 +542,20 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) } /* - * Trim a colon suffix off the hostname if it's there. + * Trim a colon suffix off the hostname if it's there. In + * order to protect IPv6 address literals against this + * treatment, we do not do this if there's _more_ than one + * colon. */ - cfg.host[strcspn(cfg.host, ":")] = '\0'; + { + char *c = strchr(cfg.host, ':'); + + if (c) { + char *d = strchr(c+1, ':'); + if (!d) + *c = '\0'; + } + } /* * Remove any remaining whitespace from the hostname. @@ -2320,7 +2331,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, Rectangle(hdc, p.rcPaint.left, p.rcPaint.top, p.rcPaint.right, p.rcPaint.bottom); - // SelectClipRgn(hdc, NULL); + /* SelectClipRgn(hdc, NULL); */ SelectObject(hdc, oldbrush); DeleteObject(fillcolour);