X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=st.c;h=c59bf1d64b71771b491f4859a344c15df5b579ea;hb=a8d5870073af14aa08032ab8520c5fe17bb8a1e8;hp=48c81a26e04bc6b167515c3793667a76ba210bdc;hpb=c0a56ef4be2a0f84360f41b2d45964e7ef297746;p=st.git diff --git a/st.c b/st.c index 48c81a2..c59bf1d 100644 --- a/st.c +++ b/st.c @@ -2152,20 +2152,21 @@ csireset(void) { void strhandle(void) { char *p = NULL; - int i, j, narg; + int j, narg, par; strparse(); narg = strescseq.narg; + par = atoi(strescseq.args[0]); switch(strescseq.type) { case ']': /* OSC -- Operating System Command */ - switch(i = atoi(strescseq.args[0])) { + switch(par) { case 0: case 1: case 2: if(narg > 1) xsettitle(strescseq.args[1]); - break; + return; case 4: /* color set */ if(narg < 3) break; @@ -2182,25 +2183,20 @@ strhandle(void) { */ redraw(0); } - break; - default: - fprintf(stderr, "erresc: unknown str "); - strdump(); - break; + return; } break; case 'k': /* old title set compatibility */ xsettitle(strescseq.args[0]); - break; + return; case 'P': /* DSC -- Device Control String */ case '_': /* APC -- Application Program Command */ case '^': /* PM -- Privacy Message */ - default: - fprintf(stderr, "erresc: unknown str "); - strdump(); - /* die(""); */ - break; + return; } + + fprintf(stderr, "erresc: unknown str "); + strdump(); } void @@ -3302,7 +3298,7 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { width, 1); } XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, winx, winy, width, - font->ascent + font->descent, winx, winy); + CEIL((font->ascent + font->descent) * chscale), winx, winy); /* Reset clip to none. */ XftDrawSetClip(xw.draw, 0);