aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorAurélien Aptel <aurelien.aptel@gmail.com>2010-09-02 20:21:40 +0200
committerAurélien Aptel <aurelien.aptel@gmail.com>2010-09-02 20:21:40 +0200
commitc68dae91d2014030803a690dfae0c851743f2ee0 (patch)
treef15b7f9dbeab3dd9fcec67306a6673656a86dfae /st.c
parent95b236a22a789b1a0153390a8dbc7886d16aff9b (diff)
downloadst-c68dae91d2014030803a690dfae0c851743f2ee0.tar.gz
st-c68dae91d2014030803a690dfae0c851743f2ee0.tar.bz2
undefined gfx doesn't draw \0.
Diffstat (limited to 'st.c')
-rw-r--r--st.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/st.c b/st.c
index ed5481d..9e66d09 100644
--- a/st.c
+++ b/st.c
@@ -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", attr[i]);
+ fprintf(stderr, "erresc: gfx attr %d unknown\n", attr[i]), csidump();
+
break;
}
}
@@ -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.font->fid);
XDrawImageString(xw.dis, xw.buf, dc.gc, winx, winy, s, len);