Skip to content

Commit

Permalink
Fix ASCII range check.
Browse files Browse the repository at this point in the history
  • Loading branch information
ueno committed Feb 3, 2013
1 parent c7e04a4 commit eaf5472
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libkkc/state.vala
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ namespace Kkc {
if (state.quoted &&
(key.modifiers == 0 ||
key.modifiers == Kkc.ModifierType.SHIFT_MASK) &&
0x20 <= key.code && key.code <= 0x7F) {
0x20 <= key.code && key.code < 0x7F) {
state.rom_kana_converter.output_nn_if_any ();
state.input_buffer.append (state.rom_kana_converter.output);
state.rom_kana_converter.output = "";
Expand Down Expand Up @@ -645,7 +645,7 @@ namespace Kkc {
}
if ((key.modifiers == 0 ||
key.modifiers == Kkc.ModifierType.SHIFT_MASK) &&
0x20 <= key.code && key.code <= 0x7F) {
0x20 <= key.code && key.code < 0x7F) {
if (state.rom_kana_converter.append (key.code)) {
state.input_buffer.append (
state.rom_kana_converter.output);
Expand All @@ -662,15 +662,15 @@ namespace Kkc {
case InputMode.LATIN:
if ((key.modifiers == 0 ||
key.modifiers == Kkc.ModifierType.SHIFT_MASK) &&
0x20 <= key.code && key.code <= 0x7F) {
0x20 <= key.code && key.code < 0x7F) {
state.input_buffer.append_c ((char) key.code);
return true;
}
break;
case InputMode.WIDE_LATIN:
if ((key.modifiers == 0 ||
key.modifiers == Kkc.ModifierType.SHIFT_MASK) &&
0x20 <= key.code && key.code <= 0x7F) {
0x20 <= key.code && key.code < 0x7F) {
state.input_buffer.append_unichar (
RomKanaUtils.get_wide_latin_char ((char) key.code));
return true;
Expand Down Expand Up @@ -759,7 +759,7 @@ namespace Kkc {
return command != null || command == "commit" ||
!((key.modifiers == 0 ||
key.modifiers == Kkc.ModifierType.SHIFT_MASK) &&
0x20 <= key.code && key.code <= 0x7F);
0x20 <= key.code && key.code < 0x7F);
}
}
}
Expand Down

0 comments on commit eaf5472

Please sign in to comment.