1. Evan Gates
  2. pcw

Commits

Evan Gates  committed 5150f2a

stick to writing the entire file so we have scrollback

  • Participants
  • Parent commits e1ae5df
  • Branches default

Comments (0)

Files changed (1)

File cw.c

View file
 
 void sigwinch(int unused)
 {
-	long pos;
-
 	if (ioctl(STDERR, TIOCGWINSZ, &ws) < 0)
 		warn("failed ioctl");
 
-	pos = ftell(in);
-	fseek(in, MAX(0, pos - (ws.ws_col * ws.ws_row)), SEEK_SET);
+	rewind(in);
 
 	while (fgets(buf, sizeof(buf), in))
 		print_line(buf);