Project

General

Profile

Submit #3375 ยป 0001-mail-1-adapt-to-terminal-size-changes.patch

neitzel, 12/16/2024 08:49 AM

View differences:

usr.bin/mail/extern.h
int setfile(char *);
void setmsize(int);
void setptr(FILE *, off_t);
void setscreensize(void);
void setscreensize(int);
int shell(char *);
void sigchild(int);
void sort(char **);
usr.bin/mail/main.c
if (ef != NULL && to != NULL)
errx(1, "Cannot give -f and people to send to.");
tinit();
setscreensize();
/*
* Initialize screensize once now and on any terminal changes later.
*/
setscreensize(0);
if (signal(SIGWINCH, setscreensize) == SIG_ERR)
perror("mail(1) won't deal with terminal size changes");
input = stdin;
rcvmode = !to;
spreserve();
......
* Width is either 80 or ws_col;
*/
void
setscreensize(void)
setscreensize(int sig)
{
struct termios tbuf;
struct winsize ws;
-
    (1-1/1)