Merge pull request #31 from terriblephrases/master

Upstream updates
This commit is contained in:
Luke Smith 2018-12-16 20:10:20 -05:00 committed by GitHub
commit edbc788d20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 11 deletions

11
st.c
View file

@ -738,8 +738,10 @@ sigchld(int a)
if (pid != p)
return;
if (!WIFEXITED(stat) || WEXITSTATUS(stat))
die("child finished with error '%d'\n", stat);
if (WIFEXITED(stat) && WEXITSTATUS(stat))
die("child exited with status %d\n", WEXITSTATUS(stat));
else if (WIFSIGNALED(stat))
die("child terminated due to signal %d\n", WTERMSIG(stat));
exit(0);
}
@ -1504,7 +1506,8 @@ tsetattr(int *attr, int l)
} else {
fprintf(stderr,
"erresc(default): gfx attr %d unknown\n",
attr[i]), csidump();
attr[i]);
csidump();
}
break;
}
@ -2388,7 +2391,7 @@ eschandle(uchar ascii)
case 'Z': /* DECID -- Identify Terminal */
ttywrite(vtiden, strlen(vtiden), 0);
break;
case 'c': /* RIS -- Reset to inital state */
case 'c': /* RIS -- Reset to initial state */
treset();
resettitle();
xloadcols();

18
x.c
View file

@ -699,6 +699,8 @@ cresize(int width, int height)
col = (win.w - 2 * borderpx) / win.cw;
row = (win.h - 2 * borderpx) / win.ch;
col = MAX(1, col);
row = MAX(1, row);
tresize(col, row);
xresize(col, row);
@ -708,8 +710,8 @@ cresize(int width, int height)
void
xresize(int col, int row)
{
win.tw = MAX(1, col * win.cw);
win.th = MAX(1, row * win.ch);
win.tw = col * win.cw;
win.th = row * win.ch;
XFreePixmap(xw.dpy, xw.buf);
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
@ -758,12 +760,12 @@ xloadcols(void)
static int loaded;
Color *cp;
dc.collen = MAX(LEN(colorname), 256);
dc.col = xmalloc(dc.collen * sizeof(Color));
if (loaded) {
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.col = xmalloc(dc.collen * sizeof(Color));
}
for (i = 0; i < dc.collen; i++)
@ -833,15 +835,17 @@ xhints(void)
sizeh = XAllocSizeHints();
sizeh->flags = PSize | PResizeInc | PBaseSize;
sizeh->flags = PSize | PResizeInc | PBaseSize | PMinSize;
sizeh->height = win.h;
sizeh->width = win.w;
sizeh->height_inc = win.ch;
sizeh->width_inc = win.cw;
sizeh->base_height = 2 * borderpx;
sizeh->base_width = 2 * borderpx;
sizeh->min_height = win.ch + 2 * borderpx;
sizeh->min_width = win.cw + 2 * borderpx;
if (xw.isfixed) {
sizeh->flags |= PMaxSize | PMinSize;
sizeh->flags |= PMaxSize;
sizeh->min_width = sizeh->max_width = win.w;
sizeh->min_height = sizeh->max_height = win.h;
}