[BACK]Return to scan.l CVS log [TXT][DIR] Up to [local] / src / usr.bin / bc

Diff for /src/usr.bin/bc/scan.l between version 1.27 and 1.28

version 1.27, 2011/08/03 08:48:19 version 1.28, 2013/09/19 16:12:01
Line 20 
Line 20 
 #include <err.h>  #include <err.h>
 #include <histedit.h>  #include <histedit.h>
 #include <signal.h>  #include <signal.h>
 #include <stdbool.h>  
 #include <string.h>  #include <string.h>
 #include <termios.h>  
 #include <unistd.h>  #include <unistd.h>
   
 #include "extern.h"  #include "extern.h"
Line 41 
Line 39 
 static bool     dot_seen;  static bool     dot_seen;
 static int      use_el;  static int      use_el;
 static volatile sig_atomic_t skipchars;  static volatile sig_atomic_t skipchars;
 struct termios ttysaved, ttyedit;  
   
 static void     init_strbuf(void);  static void     init_strbuf(void);
 static void     add_str(const char *);  static void     add_str(const char *);
Line 252 
Line 249 
                 skipchars = info->lastchar - info->buffer;                  skipchars = info->lastchar - info->buffer;
         } else          } else
                 write(STDOUT_FILENO, str1, sizeof(str1) - 1);                  write(STDOUT_FILENO, str1, sizeof(str1) - 1);
         errno = save_errno;  
 }  
   
 int  
 settty(struct termios *t)  
 {  
         int ret;  
   
         while ((ret = tcsetattr(0, TCSADRAIN,  t) == -1) && errno == EINTR)  
                 continue;  
         return ret;  
 }  
   
 int  
 gettty(struct termios *t)  
 {  
         int ret;  
   
         while ((ret = tcgetattr(0, t) == -1) && errno == EINTR)  
                 continue;  
         return ret;  
 }  
   
 /* ARGSUSED */  
 void  
 tstpcont(int sig)  
 {  
         int save_errno = errno;  
   
         if (sig == SIGTSTP) {  
                 signal(SIGCONT, tstpcont);  
                 gettty(&ttyedit);  
                 settty(&ttysaved);  
         } else {  
                 signal(SIGTSTP, tstpcont);  
                 settty(&ttyedit);  
         }  
         signal(sig, SIG_DFL);  
         kill(0, sig);  
         errno = save_errno;          errno = save_errno;
 }  }
   

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28