aboutsummaryrefslogtreecommitdiff
path: root/x11/sterm
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2020-06-11 12:04:50 +0000
committerPiotr Kubaj <pkubaj@FreeBSD.org>2020-06-11 12:04:50 +0000
commitdd5b0ab91537a78fc777c351f2b360fa461daa94 (patch)
tree03bc1f4afc7c3893c172c681c2fb2ad36682c7ff /x11/sterm
parent9a7c1eee6b1c73fbfaa327fbc5a73cbc1c78ca15 (diff)
downloadports-dd5b0ab91537a78fc777c351f2b360fa461daa94.tar.gz
ports-dd5b0ab91537a78fc777c351f2b360fa461daa94.zip
x11/sterm: update scrollback and solarized patches to new versions, add open_copied_url patch
Instead of storing the patches in ports, use PATCH_SITES and PATCHFILES. PR: 247159 Reported by: gspurki@gmail.com
Notes
Notes: svn path=/head/; revision=538473
Diffstat (limited to 'x11/sterm')
-rw-r--r--x11/sterm/Makefile17
-rw-r--r--x11/sterm/distinfo10
-rw-r--r--x11/sterm/files/extra-scrollback-patch-config.def.h11
-rw-r--r--x11/sterm/files/extra-scrollback-patch-st.c300
-rw-r--r--x11/sterm/files/extra-scrollback-patch-st.h31
-rw-r--r--x11/sterm/files/extra-solarized-patch-config.def.h95
-rw-r--r--x11/sterm/files/extra-solarized-patch-st.h10
-rw-r--r--x11/sterm/files/extra-solarized-patch-x.c98
8 files changed, 19 insertions, 553 deletions
diff --git a/x11/sterm/Makefile b/x11/sterm/Makefile
index d3259ddc45f0..e4a179163bb5 100644
--- a/x11/sterm/Makefile
+++ b/x11/sterm/Makefile
@@ -29,17 +29,20 @@ PORTDOCS= FAQ LEGACY README TODO
OPTIONS_DEFINE= DOCS
OPTIONS_RADIO= PATCHES
-OPTIONS_RADIO_PATCHES= SCROLLBACK SOLARIZED
+OPTIONS_RADIO_PATCHES= OPEN_COPIED_URL SCROLLBACK SOLARIZED
+OPEN_COPIED_URL_DESC= Open contents of the clipboard in a user-defined browser
SCROLLBACK_DESC= Scroll back through terminal output
SOLARIZED_DESC= Use Solarized color scheme
-SCROLLBACK_EXTRA_PATCHES= ${PATCHDIR}/extra-scrollback-patch-config.def.h \
- ${PATCHDIR}/extra-scrollback-patch-st.c \
- ${PATCHDIR}/extra-scrollback-patch-st.h
+OPEN_COPIED_URL_PATCH_SITES= https://st.suckless.org/patches/open_copied_url/
+OPEN_COPIED_URL_PATCHFILES= st-openclipboard-20190202-3be4cf1.diff:-p1
-SOLARIZED_EXTRA_PATCHES= ${PATCHDIR}/extra-solarized-patch-config.def.h \
- ${PATCHDIR}/extra-solarized-patch-x.c \
- ${PATCHDIR}/extra-solarized-patch-st.h
+SCROLLBACK_PATCH_SITES= https://st.suckless.org/patches/scrollback/
+SCROLLBACK_PATCHFILES= st-scrollback-20200419-72e3f6c.diff:-p1 \
+ st-scrollback-mouse-20191024-a2c479c.diff:-p1
+
+SOLARIZED_PATCH_SITES= https://st.suckless.org/patches/solarized/
+SOLARIZED_PATCHFILES= solarized/st-solarized-both-0.8.3.diff:-p1
pre-everything::
@${ECHO_MSG} "You can build st with your own config.h using the ST_CONF knob:"
diff --git a/x11/sterm/distinfo b/x11/sterm/distinfo
index 92ed8561676f..b565bf158009 100644
--- a/x11/sterm/distinfo
+++ b/x11/sterm/distinfo
@@ -1,3 +1,11 @@
-TIMESTAMP = 1591358756
+TIMESTAMP = 1591876806
SHA256 (st-0.8.3.tar.gz) = 939ae3da237e7c9489694853c205c7cbd5f2a2f0c17fe41a07477f1df8e28552
SIZE (st-0.8.3.tar.gz) = 46292
+SHA256 (st-openclipboard-20190202-3be4cf1.diff) = e7a1a8dd90b30286236baafec2a00113aca21c91f4e9cbb2ec4a519f224274cb
+SIZE (st-openclipboard-20190202-3be4cf1.diff) = 1692
+SHA256 (st-scrollback-20200419-72e3f6c.diff) = 1e41fe17a5ef5a8194eea07422b49d815e2c2bb4d58d84771f793be423005310
+SIZE (st-scrollback-20200419-72e3f6c.diff) = 8904
+SHA256 (st-scrollback-mouse-20191024-a2c479c.diff) = 319458d980195d18fa0f81a6898d58f8d046c5ff982ab872d741f54bb60e267d
+SIZE (st-scrollback-mouse-20191024-a2c479c.diff) = 622
+SHA256 (st-solarized-both-0.8.3.diff) = 8ac1ca8daa4b5f4509c95fe9d6447d6cde68bc74181ad9160da6374be824aa9d
+SIZE (st-solarized-both-0.8.3.diff) = 5708
diff --git a/x11/sterm/files/extra-scrollback-patch-config.def.h b/x11/sterm/files/extra-scrollback-patch-config.def.h
deleted file mode 100644
index 3eb83f992160..000000000000
--- a/x11/sterm/files/extra-scrollback-patch-config.def.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- config.def.h.orig 2019-02-09 12:50:41.000000000 +0100
-+++ config.def.h 2019-02-11 14:03:37.626887000 +0100
-@@ -178,6 +178,8 @@
- { TERMMOD, XK_Y, selpaste, {.i = 0} },
- { ShiftMask, XK_Insert, selpaste, {.i = 0} },
- { TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
-+ { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} },
-+ { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} },
- };
-
- /*
diff --git a/x11/sterm/files/extra-scrollback-patch-st.c b/x11/sterm/files/extra-scrollback-patch-st.c
deleted file mode 100644
index 6dcbd1a599dd..000000000000
--- a/x11/sterm/files/extra-scrollback-patch-st.c
+++ /dev/null
@@ -1,300 +0,0 @@
---- st.c.orig 2018-03-20 20:29:59 UTC
-+++ st.c
-@@ -121,6 +121,9 @@ typedef struct {
- int col; /* nb col */
- Line *line; /* screen */
- Line *alt; /* alternate screen */
-+ Line hist[HISTSIZE]; /* history buffer */
-+ int histi; /* history index */
-+ int scr; /* scroll back */
- int *dirty; /* dirtyness of lines */
- TCursor c; /* cursor */
- int ocx; /* old cursor col */
-@@ -188,8 +191,8 @@ static void tnewline(int);
- static void tputtab(int);
- static void tputc(Rune);
- static void treset(void);
--static void tscrollup(int, int);
--static void tscrolldown(int, int);
-+static void tscrollup(int, int, int);
-+static void tscrolldown(int, int, int);
- static void tsetattr(int *, int);
- static void tsetchar(Rune, Glyph *, int, int);
- static void tsetdirt(int, int);
-@@ -431,10 +434,10 @@ tlinelen(int y)
- {
- int i = term.col;
-
-- if (term.line[y][i - 1].mode & ATTR_WRAP)
-+ if (TLINE(y)[i - 1].mode & ATTR_WRAP)
- return i;
-
-- while (i > 0 && term.line[y][i - 1].u == ' ')
-+ while (i > 0 && TLINE(y)[i - 1].u == ' ')
- --i;
-
- return i;
-@@ -543,7 +546,7 @@ selsnap(int *x, int *y, int direction)
- * Snap around if the word wraps around at the end or
- * beginning of a line.
- */
-- prevgp = &term.line[*y][*x];
-+ prevgp = &TLINE(*y)[*x];
- prevdelim = ISDELIM(prevgp->u);
- for (;;) {
- newx = *x + direction;
-@@ -558,14 +561,14 @@ selsnap(int *x, int *y, int direction)
- yt = *y, xt = *x;
- else
- yt = newy, xt = newx;
-- if (!(term.line[yt][xt].mode & ATTR_WRAP))
-+ if (!(TLINE(yt)[xt].mode & ATTR_WRAP))
- break;
- }
-
- if (newx >= tlinelen(newy))
- break;
-
-- gp = &term.line[newy][newx];
-+ gp = &TLINE(newy)[newx];
- delim = ISDELIM(gp->u);
- if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim
- || (delim && gp->u != prevgp->u)))
-@@ -586,14 +589,14 @@ selsnap(int *x, int *y, int direction)
- *x = (direction < 0) ? 0 : term.col - 1;
- if (direction < 0) {
- for (; *y > 0; *y += direction) {
-- if (!(term.line[*y-1][term.col-1].mode
-+ if (!(TLINE(*y-1)[term.col-1].mode
- & ATTR_WRAP)) {
- break;
- }
- }
- } else if (direction > 0) {
- for (; *y < term.row-1; *y += direction) {
-- if (!(term.line[*y][term.col-1].mode
-+ if (!(TLINE(*y)[term.col-1].mode
- & ATTR_WRAP)) {
- break;
- }
-@@ -624,13 +627,13 @@ getsel(void)
- }
-
- if (sel.type == SEL_RECTANGULAR) {
-- gp = &term.line[y][sel.nb.x];
-+ gp = &TLINE(y)[sel.nb.x];
- lastx = sel.ne.x;
- } else {
-- gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0];
-+ gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0];
- lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1;
- }
-- last = &term.line[y][MIN(lastx, linelen-1)];
-+ last = &TLINE(y)[MIN(lastx, linelen-1)];
- while (last >= gp && last->u == ' ')
- --last;
-
-@@ -835,6 +838,9 @@ ttyread(void)
- if (buflen > 0)
- memmove(buf, buf + written, buflen);
-
-+ if (term.scr > 0 && term.scr < HISTSIZE-1)
-+ term.scr++;
-+
- return ret;
- }
-
-@@ -842,6 +848,9 @@ void
- ttywrite(const char *s, size_t n, int may_echo)
- {
- const char *next;
-+ Arg arg = (Arg) { .i = term.scr };
-+
-+ kscrolldown(&arg);
-
- if (may_echo && IS_SET(MODE_ECHO))
- twrite(s, n, 1);
-@@ -1053,13 +1062,54 @@ tswapscreen(void)
- }
-
- void
--tscrolldown(int orig, int n)
-+kscrolldown(const Arg* a)
-+{
-+ int n = a->i;
-+
-+ if (n < 0)
-+ n = term.row + n;
-+
-+ if (n > term.scr)
-+ n = term.scr;
-+
-+ if (term.scr > 0) {
-+ term.scr -= n;
-+ selscroll(0, -n);
-+ tfulldirt();
-+ }
-+}
-+
-+void
-+kscrollup(const Arg* a)
-+{
-+ int n = a->i;
-+
-+ if (n < 0)
-+ n = term.row + n;
-+
-+ if (term.scr <= HISTSIZE-n) {
-+ term.scr += n;
-+ selscroll(0, n);
-+ tfulldirt();
-+ }
-+}
-+
-+
-+void
-+tscrolldown(int orig, int n, int copyhist)
- {
- int i;
- Line temp;
-
- LIMIT(n, 0, term.bot-orig+1);
-
-+ if (copyhist) {
-+ term.histi = (term.histi - 1 + HISTSIZE) % HISTSIZE;
-+ temp = term.hist[term.histi];
-+ term.hist[term.histi] = term.line[term.bot];
-+ term.line[term.bot] = temp;
-+ }
-+
- tsetdirt(orig, term.bot-n);
- tclearregion(0, term.bot-n+1, term.col-1, term.bot);
-
-@@ -1073,13 +1123,20 @@ tscrolldown(int orig, int n)
- }
-
- void
--tscrollup(int orig, int n)
-+tscrollup(int orig, int n, int copyhist)
- {
- int i;
- Line temp;
-
- LIMIT(n, 0, term.bot-orig+1);
-
-+ if (copyhist) {
-+ term.histi = (term.histi + 1) % HISTSIZE;
-+ temp = term.hist[term.histi];
-+ term.hist[term.histi] = term.line[orig];
-+ term.line[orig] = temp;
-+ }
-+
- tclearregion(0, orig, term.col-1, orig+n-1);
- tsetdirt(orig+n, term.bot);
-
-@@ -1128,7 +1185,7 @@ tnewline(int first_col)
- int y = term.c.y;
-
- if (y == term.bot) {
-- tscrollup(term.top, 1);
-+ tscrollup(term.top, 1, 1);
- } else {
- y++;
- }
-@@ -1293,14 +1350,14 @@ void
- tinsertblankline(int n)
- {
- if (BETWEEN(term.c.y, term.top, term.bot))
-- tscrolldown(term.c.y, n);
-+ tscrolldown(term.c.y, n, 0);
- }
-
- void
- tdeleteline(int n)
- {
- if (BETWEEN(term.c.y, term.top, term.bot))
-- tscrollup(term.c.y, n);
-+ tscrollup(term.c.y, n, 0);
- }
-
- int32_t
-@@ -1729,11 +1786,11 @@ csihandle(void)
- break;
- case 'S': /* SU -- Scroll <n> line up */
- DEFAULT(csiescseq.arg[0], 1);
-- tscrollup(term.top, csiescseq.arg[0]);
-+ tscrollup(term.top, csiescseq.arg[0], 0);
- break;
- case 'T': /* SD -- Scroll <n> line down */
- DEFAULT(csiescseq.arg[0], 1);
-- tscrolldown(term.top, csiescseq.arg[0]);
-+ tscrolldown(term.top, csiescseq.arg[0], 0);
- break;
- case 'L': /* IL -- Insert <n> blank lines */
- DEFAULT(csiescseq.arg[0], 1);
-@@ -2257,7 +2314,7 @@ eschandle(uchar ascii)
- return 0;
- case 'D': /* IND -- Linefeed */
- if (term.c.y == term.bot) {
-- tscrollup(term.top, 1);
-+ tscrollup(term.top, 1, 1);
- } else {
- tmoveto(term.c.x, term.c.y+1);
- }
-@@ -2270,7 +2327,7 @@ eschandle(uchar ascii)
- break;
- case 'M': /* RI -- Reverse index */
- if (term.c.y == term.top) {
-- tscrolldown(term.top, 1);
-+ tscrolldown(term.top, 1, 1);
- } else {
- tmoveto(term.c.x, term.c.y-1);
- }
-@@ -2489,7 +2546,7 @@ twrite(const char *buf, int buflen, int
- void
- tresize(int col, int row)
- {
-- int i;
-+ int i, j;
- int minrow = MIN(row, term.row);
- int mincol = MIN(col, term.col);
- int *bp;
-@@ -2526,7 +2583,15 @@ tresize(int col, int row)
- term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty));
- term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs));
-
-- /* resize each row to new width, zero-pad if needed */
-+ for (i = 0; i < HISTSIZE; i++) {
-+ term.hist[i] = xrealloc(term.hist[i], col * sizeof(Glyph));
-+ for (j = mincol; j < col; j++) {
-+ term.hist[i][j] = term.c.attr;
-+ term.hist[i][j].u = ' ';
-+ }
-+ }
-+
-+ /* resize each r w to new width, zero-pad if needed */
- for (i = 0; i < minrow; i++) {
- term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph));
- term.alt[i] = xrealloc(term.alt[i], col * sizeof(Glyph));
-@@ -2583,7 +2648,7 @@ drawregion(int x1, int y1, int x2, int y
- continue;
-
- term.dirty[y] = 0;
-- xdrawline(term.line[y], x1, y, x2);
-+ xdrawline(TLINE(y), x1, y, x2);
- }
- }
-
-@@ -2604,8 +2669,10 @@ draw(void)
- cx--;
-
- drawregion(0, 0, term.col, term.row);
-- xdrawcursor(cx, term.c.y, term.line[term.c.y][cx],
-- term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
-+ if (term.scr == 0) {
-+ xdrawcursor(cx, term.c.y, term.line[term.c.y][cx],
-+ term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
-+ }
- term.ocx = cx, term.ocy = term.c.y;
- xfinishdraw();
- }
diff --git a/x11/sterm/files/extra-scrollback-patch-st.h b/x11/sterm/files/extra-scrollback-patch-st.h
deleted file mode 100644
index 1d3b896ec9aa..000000000000
--- a/x11/sterm/files/extra-scrollback-patch-st.h
+++ /dev/null
@@ -1,31 +0,0 @@
---- st.h.orig 2018-03-20 20:29:59 UTC
-+++ st.h
-@@ -3,6 +3,9 @@
- #include <stdint.h>
- #include <sys/types.h>
-
-+/* Arbitrary size */
-+#define HISTSIZE 2000
-+
- /* macros */
- #define MIN(a, b) ((a) < (b) ? (a) : (b))
- #define MAX(a, b) ((a) < (b) ? (b) : (a))
-@@ -19,6 +22,8 @@
-
- #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
- #define IS_TRUECOL(x) (1 << 24 & (x))
-+#define TLINE(y) ((y) < term.scr ? term.hist[((y) + term.histi - term.scr \
-+ + HISTSIZE + 1) % HISTSIZE] : term.line[(y) - term.scr])
-
- enum glyph_attribute {
- ATTR_NULL = 0,
-@@ -111,6 +116,9 @@ void *xmalloc(size_t);
- void *xrealloc(void *, size_t);
- char *xstrdup(char *);
-
-+void kscrolldown(const Arg *);
-+void kscrollup(const Arg *);
-+
- /* config.h globals */
- extern char *utmp;
- extern char *stty_args;
diff --git a/x11/sterm/files/extra-solarized-patch-config.def.h b/x11/sterm/files/extra-solarized-patch-config.def.h
deleted file mode 100644
index 7ec1b139a27e..000000000000
--- a/x11/sterm/files/extra-solarized-patch-config.def.h
+++ /dev/null
@@ -1,95 +0,0 @@
---- config.def.h.orig 2019-02-09 12:50:41.000000000 +0100
-+++ config.def.h 2019-02-11 13:45:28.209172000 +0100
-@@ -84,31 +84,44 @@
-
- /* Terminal colors (16 first used in escape sequence) */
- static const char *colorname[] = {
-- /* 8 normal colors */
-- "black",
-- "red3",
-- "green3",
-- "yellow3",
-- "blue2",
-- "magenta3",
-- "cyan3",
-- "gray90",
--
-- /* 8 bright colors */
-- "gray50",
-- "red",
-- "green",
-- "yellow",
-- "#5c5cff",
-- "magenta",
-- "cyan",
-- "white",
--
-- [255] = 0,
--
-- /* more colors can be added after 255 to use with DefaultXX */
-- "#cccccc",
-- "#555555",
-+ /* solarized dark */
-+ "#073642", /* 0: black */
-+ "#dc322f", /* 1: red */
-+ "#859900", /* 2: green */
-+ "#b58900", /* 3: yellow */
-+ "#268bd2", /* 4: blue */
-+ "#d33682", /* 5: magenta */
-+ "#2aa198", /* 6: cyan */
-+ "#eee8d5", /* 7: white */
-+ "#002b36", /* 8: brblack */
-+ "#cb4b16", /* 9: brred */
-+ "#586e75", /* 10: brgreen */
-+ "#657b83", /* 11: bryellow */
-+ "#839496", /* 12: brblue */
-+ "#6c71c4", /* 13: brmagenta*/
-+ "#93a1a1", /* 14: brcyan */
-+ "#fdf6e3", /* 15: brwhite */
-+};
-+
-+/* Terminal colors for alternate (light) palette */
-+static const char *altcolorname[] = {
-+ /* solarized light */
-+ "#eee8d5", /* 0: black */
-+ "#dc322f", /* 1: red */
-+ "#859900", /* 2: green */
-+ "#b58900", /* 3: yellow */
-+ "#268bd2", /* 4: blue */
-+ "#d33682", /* 5: magenta */
-+ "#2aa198", /* 6: cyan */
-+ "#073642", /* 7: white */
-+ "#fdf6e3", /* 8: brblack */
-+ "#cb4b16", /* 9: brred */
-+ "#93a1a1", /* 10: brgreen */
-+ "#839496", /* 11: bryellow */
-+ "#657b83", /* 12: brblue */
-+ "#6c71c4", /* 13: brmagenta*/
-+ "#586e75", /* 14: brcyan */
-+ "#002b36", /* 15: brwhite */
- };
-
-
-@@ -116,10 +129,10 @@
- * Default colors (colorname index)
- * foreground, background, cursor, reverse cursor
- */
--unsigned int defaultfg = 7;
--unsigned int defaultbg = 0;
--static unsigned int defaultcs = 256;
--static unsigned int defaultrcs = 257;
-+unsigned int defaultfg = 12;
-+unsigned int defaultbg = 8;
-+static unsigned int defaultcs = 14;
-+static unsigned int defaultrcs = 15;
-
- /*
- * Default shape of cursor
-@@ -178,6 +191,7 @@
- { TERMMOD, XK_Y, selpaste, {.i = 0} },
- { ShiftMask, XK_Insert, selpaste, {.i = 0} },
- { TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
-+ { XK_ANY_MOD, XK_F6, swapcolors, {.i = 0} },
- };
-
- /*
diff --git a/x11/sterm/files/extra-solarized-patch-st.h b/x11/sterm/files/extra-solarized-patch-st.h
deleted file mode 100644
index 2d9c0a73a178..000000000000
--- a/x11/sterm/files/extra-solarized-patch-st.h
+++ /dev/null
@@ -1,10 +0,0 @@
---- st.h.orig 2018-03-20 20:29:59 UTC
-+++ st.h
-@@ -118,6 +118,7 @@ extern char *vtiden;
- extern char *worddelimiters;
- extern int allowaltscreen;
- extern char *termname;
-+extern int usealtcolors;
- extern unsigned int tabspaces;
- extern unsigned int defaultfg;
- extern unsigned int defaultbg;
diff --git a/x11/sterm/files/extra-solarized-patch-x.c b/x11/sterm/files/extra-solarized-patch-x.c
deleted file mode 100644
index 29dbcc10f9bb..000000000000
--- a/x11/sterm/files/extra-solarized-patch-x.c
+++ /dev/null
@@ -1,98 +0,0 @@
---- x.c.orig 2019-02-09 12:50:41.000000000 +0100
-+++ x.c 2019-02-11 14:02:22.026884000 +0100
-@@ -53,6 +53,7 @@
- static void clippaste(const Arg *);
- static void numlock(const Arg *);
- static void selpaste(const Arg *);
-+static void swapcolors(const Arg *);
- static void zoom(const Arg *);
- static void zoomabs(const Arg *);
- static void zoomreset(const Arg *);
-@@ -240,6 +241,8 @@
-
- static int oldbutton = 3; /* button event on startup: 3 = release */
-
-+int usealtcolors = 0; /* 1 to use alternate palette */
-+
- void
- clipcopy(const Arg *dummy)
- {
-@@ -279,6 +282,14 @@
- }
-
- void
-+swapcolors(const Arg *dummy)
-+{
-+ usealtcolors = !usealtcolors;
-+ xloadcols();
-+ redraw();
-+}
-+
-+void
- zoom(const Arg *arg)
- {
- Arg larg;
-@@ -702,6 +713,11 @@
- return x == 0 ? 0 : 0x3737 + 0x2828 * x;
- }
-
-+const char* getcolorname(int i)
-+{
-+ return (usealtcolors) ? altcolorname[i] : colorname[i];
-+}
-+
- int
- xloadcolor(int i, const char *name, Color *ncolor)
- {
-@@ -720,7 +736,7 @@
- return XftColorAllocValue(xw.dpy, xw.vis,
- xw.cmap, &color, ncolor);
- } else
-- name = colorname[i];
-+ name = getcolorname(i);
- }
-
- return XftColorAllocName(xw.dpy, xw.vis, xw.cmap, name, ncolor);
-@@ -737,14 +753,14 @@
- for (cp = dc.col; cp < &dc.col[dc.collen]; ++cp)
- XftColorFree(xw.dpy, xw.vis, xw.cmap, cp);
- } else {
-- dc.collen = MAX(LEN(colorname), 256);
-+ dc.collen = MAX(LEN(colorname), LEN(altcolorname));
- dc.col = xmalloc(dc.collen * sizeof(Color));
- }
-
- for (i = 0; i < dc.collen; i++)
- if (!xloadcolor(i, NULL, &dc.col[i])) {
-- if (colorname[i])
-- die("could not allocate color '%s'\n", colorname[i]);
-+ if (getcolorname(i))
-+ die("could not allocate color '%s'\n", getcolorname(i));
- else
- die("could not allocate color %d\n", i);
- }
-@@ -1082,13 +1098,13 @@
- cursor = XCreateFontCursor(xw.dpy, mouseshape);
- XDefineCursor(xw.dpy, xw.win, cursor);
-
-- if (XParseColor(xw.dpy, xw.cmap, colorname[mousefg], &xmousefg) == 0) {
-+ if (XParseColor(xw.dpy, xw.cmap, getcolorname(mousefg), &xmousefg) == 0) {
- xmousefg.red = 0xffff;
- xmousefg.green = 0xffff;
- xmousefg.blue = 0xffff;
- }
-
-- if (XParseColor(xw.dpy, xw.cmap, colorname[mousebg], &xmousebg) == 0) {
-+ if (XParseColor(xw.dpy, xw.cmap, getcolorname(mousebg), &xmousebg) == 0) {
- xmousebg.red = 0x0000;
- xmousebg.green = 0x0000;
- xmousebg.blue = 0x0000;
-@@ -1298,7 +1314,7 @@
-
- /* Change basic system colors [0-7] to bright system colors [8-15] */
- if ((base.mode & ATTR_BOLD_FAINT) == ATTR_BOLD && BETWEEN(base.fg, 0, 7))
-- fg = &dc.col[base.fg + 8];
-+ fg = &dc.col[base.fg];
-
- if (IS_SET(MODE_REVERSE)) {
- if (fg == &dc.col[defaultfg]) {