Introduction
Introduction Statistics Contact Development Disclaimer Help
tundefined gfx doesn't draw \0. - st - [fork] customized build of st, the simpl…
git clone git://src.adamsgaard.dk/st
Log
Files
Refs
README
LICENSE
---
commit 223909e008bae6fce33cc1ad72e8480fc36805ca
parent b6af0fdc20cd79861fbf770c71484ec04405e744
Author: AurĂ©lien Aptel <[email protected]>
Date: Thu, 2 Sep 2010 20:21:40 +0200
undefined gfx doesn't draw \0.
Diffstat:
M st.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/st.c b/st.c
t@@ -677,7 +677,8 @@ tsetattr(int *attr, int l) {
else if(BETWEEN(attr[i], 100, 107))
term.c.attr.fg = attr[i] - 100 + 8;
else
- fprintf(stderr, "erresc: gfx attr %d unknown\n…
+ fprintf(stderr, "erresc: gfx attr %d unknown\n…
+
break;
}
}
t@@ -1230,8 +1231,13 @@ xdraws(char *s, Glyph base, int x, int y, int len) {
XSetForeground(xw.dis, dc.gc, xfg);
if(base.mode & ATTR_GFX)
- for(i = 0; i < len; i++)
- s[i] = gfx[(int)s[i]];
+ for(i = 0; i < len; i++) {
+ char c = gfx[(unsigned int)s[i] % 256];
+ if(c)
+ s[i] = c;
+ else if(s[i] > 0x5f)
+ s[i] -= 0x5f;
+ }
XSetFont(xw.dis, dc.gc, base.mode & ATTR_BOLD ? dc.bfont->fid : dc.fon…
XDrawImageString(xw.dis, xw.buf, dc.gc, winx, winy, s, len);
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.