[BACK]Return to ttyin.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / less

Diff for /src/usr.bin/less/ttyin.c between version 1.3 and 1.4

version 1.3, 2003/04/13 18:26:26 version 1.4, 2011/09/16 18:12:09
Line 1 
Line 1 
 /*  /*
  * Copyright (C) 1984-2002  Mark Nudelman   * Copyright (C) 1984-2011  Mark Nudelman
  *   *
  * You may distribute under the terms of either the GNU General Public   * You may distribute under the terms of either the GNU General Public
  * License or the Less License, as specified in the README file.   * License or the Less License, as specified in the README file.
Line 26 
Line 26 
   
 public int tty;  public int tty;
 extern int sigs;  extern int sigs;
   extern int utf_mode;
   
 /*  /*
  * Open keyboard for input.   * Open keyboard for input.
Line 132 
Line 133 
                         quit(QUIT_ERROR);                          quit(QUIT_ERROR);
                 }                  }
 #endif  #endif
   #if 0 /* allow entering arbitrary hex chars for testing */
                   /* ctrl-A followed by two hex chars makes a byte */
           {
                   int hex_in = 0;
                   int hex_value = 0;
                   if (c == CONTROL('A'))
                   {
                           hex_in = 2;
                           result = 0;
                           continue;
                   }
                   if (hex_in > 0)
                   {
                           int v;
                           if (c >= '0' && c <= '9')
                                   v = c - '0';
                           else if (c >= 'a' && c <= 'f')
                                   v = c - 'a' + 10;
                           else if (c >= 'A' && c <= 'F')
                                   v = c - 'A' + 10;
                           else
                                   hex_in = 0;
                           hex_value = (hex_value << 4) | v;
                           if (--hex_in > 0)
                           {
                                   result = 0;
                                   continue;
                           }
                           c = hex_value;
                   }
           }
   #endif
                 /*                  /*
                  * Various parts of the program cannot handle                   * Various parts of the program cannot handle
                  * an input character of '\0'.                   * an input character of '\0'.
Line 141 
Line 174 
                         c = '\340';                          c = '\340';
         } while (result != 1);          } while (result != 1);
   
         return (c & 0377);          return (c & 0xFF);
 }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4