- * 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';
+ }
+ }
* Initialise the terminal. (We have to do this _after_
* creating the window, since the terminal is the first thing
* which will call schedule_timer(), which will in turn call
* Initialise the terminal. (We have to do this _after_
* creating the window, since the terminal is the first thing
* which will call schedule_timer(), which will in turn call
*/
term = term_init(&cfg, &ucsdata, NULL);
logctx = log_init(NULL, &cfg);
*/
term = term_init(&cfg, &ucsdata, NULL);
logctx = log_init(NULL, &cfg);
HBRUSH fillcolour, oldbrush;
HPEN edge, oldpen;
fillcolour = CreateSolidBrush (
HBRUSH fillcolour, oldbrush;
HPEN edge, oldpen;
fillcolour = CreateSolidBrush (
oldbrush = SelectObject(hdc, fillcolour);
edge = CreatePen(PS_SOLID, 0,
oldbrush = SelectObject(hdc, fillcolour);
edge = CreatePen(PS_SOLID, 0,
Rectangle(hdc, p.rcPaint.left, p.rcPaint.top,
p.rcPaint.right, p.rcPaint.bottom);
Rectangle(hdc, p.rcPaint.left, p.rcPaint.top,
p.rcPaint.right, p.rcPaint.bottom);
SelectObject(hdc, oldbrush);
DeleteObject(fillcolour);
SelectObject(hdc, oldbrush);
DeleteObject(fillcolour);
- SelectObject(hdc, CreatePen(PS_SOLID, 0, colours[23]));
+ SelectObject(hdc, CreatePen(PS_SOLID, 0, colours[261]));
MoveToEx(hdc, startx, starty, NULL);
LineTo(hdc, startx + dx * length, starty + dy * length);
oldpen = SelectObject(hdc, oldpen);
MoveToEx(hdc, startx, starty, NULL);
LineTo(hdc, startx + dx * length, starty + dy * length);
oldpen = SelectObject(hdc, oldpen);
- SetPixel(hdc, startx, starty, colours[23]);
+ SetPixel(hdc, startx, starty, colours[261]);