} und_mode;
static int descent;
-#define NCFGCOLOURS 24
+#define NCFGCOLOURS 22
#define NEXTCOLOURS 240
#define NALLCOLOURS (NCFGCOLOURS + NEXTCOLOURS)
static COLORREF colours[NALLCOLOURS];
}
/*
- * 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.
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;
{
HBRUSH fillcolour, oldbrush;
HPEN edge, oldpen;
fillcolour = CreateSolidBrush (
- colours[(ATTR_DEFBG>>ATTR_BGSHIFT)*2]);
+ colours[ATTR_DEFBG>>ATTR_BGSHIFT]);
oldbrush = SelectObject(hdc, fillcolour);
edge = CreatePen(PS_SOLID, 0,
- colours[(ATTR_DEFBG>>ATTR_BGSHIFT)*2]);
+ colours[ATTR_DEFBG>>ATTR_BGSHIFT]);
oldpen = SelectObject(hdc, edge);
/*
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);
if (attr & TATTR_ACTCURS) {
HPEN oldpen;
oldpen =
- 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);
} else {
for (i = 0; i < length; i++) {
if (i % 2 == 0) {
- SetPixel(hdc, startx, starty, colours[23]);
+ SetPixel(hdc, startx, starty, colours[261]);
}
startx += dx;
starty += dy;