Don't try to use TIOCGWINSZ if termios.h is not available.
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 16 Apr 2017 12:18:29 +0000 (14:18 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 16 Apr 2017 12:18:29 +0000 (14:18 +0200)
src/ui/terminal/terminal.c

index bc47e3c84422c22c96bf2fc9c72922719e5be9ae..c8a605d8f2eb4169ead36f70d3e6622779414cb9 100644 (file)
@@ -48,6 +48,7 @@ terminal_check_size (void)
   int view_width = 0;
   int view_length = 0;
 
+#ifdef HAVE_TERMIOS_H
   struct winsize ws;
   if (0 == ioctl (0, TIOCGWINSZ, &ws))
     {
@@ -55,6 +56,7 @@ terminal_check_size (void)
       view_length = ws.ws_row;
     }
   else
+#endif
     {
       if (view_width <= 0 && getenv ("COLUMNS") != NULL)
        view_width = atoi (getenv ("COLUMNS"));