don't allow 0 in ioctl to clear earlier CSI14t response #2000

pull/2011/head
nick black 3 years ago
parent 56636ca57c
commit aeadc7e499
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -266,9 +266,14 @@ int update_term_dimensions(int fd, int* rows, int* cols, tinfo* tcache,
if(tcache->linux_fb_fd >= 0){
get_linux_fb_pixelgeom(tcache, &tcache->pixy, &tcache->pixx);
}else{
// we might have the pixel geometry from CSI14t, so don't override a
// valid earlier response with 0s from the ioctl. we do want to fire
// off a fresh CSI14t in this case, though FIXME.
if(ws.ws_ypixel){
tcache->pixy = ws.ws_ypixel;
tcache->pixx = ws.ws_xpixel;
}
}
tcache->cellpixy = ws.ws_row ? tcache->pixy / ws.ws_row : 0;
tcache->cellpixx = ws.ws_col ? tcache->pixx / ws.ws_col : 0;
if(tcache->cellpixy == 0 || tcache->cellpixx == 0){

Loading…
Cancel
Save