X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwindow.c;h=17aaf1ae591a260af779e547ef7e5150b0b731ca;hb=550f7b37cb7dbe0dcd68d2ac2c3b529e643599b3;hp=b0d7d5c25f5c24651dae3b5d002520c3f9642efc;hpb=4cae179ff8c8198dfc7aa2fd98400bc03c940d15;p=PuTTY.git diff --git a/windows/window.c b/windows/window.c index b0d7d5c2..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. @@ -1900,7 +1911,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, GetWindowText(hwnd, cfg.wintitle, sizeof(cfg.wintitle)); prev_cfg = cfg; - if (!do_reconfig(hwnd)) + if (!do_reconfig(hwnd, back ? back->cfg_info(backhandle) : 0)) break; { @@ -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);