[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.26 and 1.27

version 1.26, 2011/06/03 06:10:33 version 1.27, 2011/08/03 08:48:19
Line 22 
Line 22 
 #include <signal.h>  #include <signal.h>
 #include <stdbool.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 40 
Line 41 
 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 253 
Line 255 
         errno = save_errno;          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;
   }
   
 /*  /*
  * Avoid the echo of ^D by the default code of editline and take   * Avoid the echo of ^D by the default code of editline and take
  * into account skipchars to make ^D work when the cursor is at start of   * into account skipchars to make ^D work when the cursor is at start of
Line 307 
Line 348 
         } else if (fileindex == sargc) {          } else if (fileindex == sargc) {
                 fileindex++;                  fileindex++;
                 yyin = stdin;                  yyin = stdin;
                 if (interactive)                  if (interactive) {
                         signal(SIGINT, abort_line);                          signal(SIGINT, abort_line);
                           signal(SIGTSTP, tstpcont);
                   }
                 lineno = 1;                  lineno = 1;
                 filename = "stdin";                  filename = "stdin";
                 return (0);                  return (0);

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