ascii.c: Move auto out of the #if HAVE_DECL_SIGWINCH condtional
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 25 Feb 2012 11:22:32 +0000 (12:22 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 26 Feb 2012 18:32:14 +0000 (19:32 +0100)
Whether or not the width/length should be automatic should depend only on whether the
output is a terminal, and not upon the existance of SIGWINCH

src/output/ascii.c

index 7804ade3f475d9e0cc08fa281be5a2d5ed6677d5..d121987a20c5d389eff0f5572a0b1386302bc2b1 100644 (file)
@@ -1085,19 +1085,19 @@ ascii_open_page (struct ascii_driver *a)
       a->file = fn_open (a->file_name, a->append ? "a" : "w");
       if (a->file != NULL)
         {
-#if HAVE_DECL_SIGWINCH
          if ( isatty (fileno (a->file)))
            {
+#if HAVE_DECL_SIGWINCH
              struct sigaction action;
              sigemptyset (&action.sa_mask);
              action.sa_flags = 0;
              action.sa_handler = winch_handler;
              the_driver = a;
+             sigaction (SIGWINCH, &action, NULL);
+#endif
              a->auto_width = true;
              a->auto_length = true;
-             sigaction (SIGWINCH, &action, NULL);
            }
-#endif
         }
       else
         {