delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/07/21/12:39:26

Date: Sun, 21 Jul 1996 19:35:02 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp-workers AT delorie DOT com
Subject: Info 3.7
Message-Id: <Pine.SUN.3.91.960721193217.6902C-100000@is>
Mime-Version: 1.0

The original port didn't switch stdin to BINARY mode, which causes SIGINT 
if you press Ctrl-C (e.g. C-x C-c should quit Info, not abort it).  These 
patches take care of that problem:

*** info/pc_term.c~0	Fri Jul 19 14:49:06 1996
--- info/pc_term.c	Sun Jul 21 18:26:56 1996
***************
*** 24,29 ****
--- 24,32 ----
  #include <limits.h>
  #include <pc.h>
  #include <conio.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <io.h>
  #include "pc_term.h"
  #include "terminal.h"
  #include "termdep.h"
*************** static unsigned char    norm_attr, inv_a
*** 41,46 ****
--- 44,54 ----
  /* Put the screen in the video mode and colors which Info will use.  */
  void pc_prep_terminal ()
  {
+   /* Switch stdin to BINARY mode.  This enables us to get
+      all the keystrokes, including Ctrl-C.  */
+   if (isatty (fileno (stdin)))
+     setmode (fileno (stdin), O_BINARY);
+ 
    textattr (norm_attr);
  
    /* Do not set screen height if we already have it, because
*************** void pc_unprep_terminal ()
*** 60,65 ****
--- 68,77 ----
    }
    textattr (norm_info.normattr);
    ScreenClear (); /* to leave behind a clean screen */
+ 
+   /* Switch stdin back to TEXT mode.  */
+   if (isatty (fileno (stdin)))
+     setmode (fileno (stdin), O_TEXT);
  }
  
  void pc_begin_inverse ()

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019