tweaks: rename a variable, and normalize the indentation
parent
6980cfbf70
commit
2a5d129738
16
src/winio.c
16
src/winio.c
|
@ -841,27 +841,27 @@ int parse_escape_sequence(int firstbyte)
|
|||
* decimal byte code (from 000 to 255). Return the assembled code when
|
||||
* it is complete, but until then return PROCEED when the given digit is
|
||||
* valid, and the given digit itself otherwise. */
|
||||
int assemble_byte_code(int kbinput)
|
||||
int assemble_byte_code(int keycode)
|
||||
{
|
||||
static int byte = 0;
|
||||
|
||||
if (++digit_count == 1) {
|
||||
/* The first digit is either 0, 1, or 2. */
|
||||
byte = (kbinput - '0') * 100;
|
||||
byte = (keycode - '0') * 100;
|
||||
return PROCEED;
|
||||
} else if (digit_count == 2) {
|
||||
/* The second digit may be at most 5 if the first was 2. */
|
||||
if (byte < 200 || kbinput <= '5') {
|
||||
byte += (kbinput - '0') * 10;
|
||||
if (byte < 200 || keycode <= '5') {
|
||||
byte += (keycode - '0') * 10;
|
||||
return PROCEED;
|
||||
} else
|
||||
return kbinput;
|
||||
return keycode;
|
||||
} else {
|
||||
/* The third digit may be at most 5 if first two were 2 and 5. */
|
||||
if (byte < 250 || kbinput <= '5') {
|
||||
return (byte + kbinput - '0');
|
||||
if (byte < 250 || keycode <= '5') {
|
||||
return (byte + keycode - '0');
|
||||
} else
|
||||
return kbinput;
|
||||
return keycode;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue