mirror of
https://github.com/alrayyes/st.git
synced 2024-11-26 04:46:22 +00:00
undefined gfx doesn't draw \0.
This commit is contained in:
parent
b6af0fdc20
commit
223909e008
1 changed files with 9 additions and 3 deletions
12
st.c
12
st.c
|
@ -677,7 +677,8 @@ tsetattr(int *attr, int l) {
|
||||||
else if(BETWEEN(attr[i], 100, 107))
|
else if(BETWEEN(attr[i], 100, 107))
|
||||||
term.c.attr.fg = attr[i] - 100 + 8;
|
term.c.attr.fg = attr[i] - 100 + 8;
|
||||||
else
|
else
|
||||||
fprintf(stderr, "erresc: gfx attr %d unknown\n", attr[i]);
|
fprintf(stderr, "erresc: gfx attr %d unknown\n", attr[i]), csidump();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1230,8 +1231,13 @@ xdraws(char *s, Glyph base, int x, int y, int len) {
|
||||||
XSetForeground(xw.dis, dc.gc, xfg);
|
XSetForeground(xw.dis, dc.gc, xfg);
|
||||||
|
|
||||||
if(base.mode & ATTR_GFX)
|
if(base.mode & ATTR_GFX)
|
||||||
for(i = 0; i < len; i++)
|
for(i = 0; i < len; i++) {
|
||||||
s[i] = gfx[(int)s[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);
|
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);
|
XDrawImageString(xw.dis, xw.buf, dc.gc, winx, winy, s, len);
|
||||||
|
|
Loading…
Reference in a new issue