Skip to content

Commit

Permalink
fix for word bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
lopex authored and electrum committed Feb 28, 2019
1 parent ba9950f commit 64bcdcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/org/joni/ByteCodeMachine.java
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ private void opWordBound() {
if (s == str) {
if (s >= range || !enc.isMbcWord(bytes, s, end)) {opFail(); return;}
} else if (s == end) {
if (!enc.isMbcWord(bytes, sprev, end)) {opFail(); return;}
if (s >= range || !enc.isMbcWord(bytes, sprev, end)) {opFail(); return;}
} else {
if (enc.isMbcWord(bytes, s, end) == enc.isMbcWord(bytes, sprev, end)) {opFail(); return;}
}
Expand All @@ -1080,7 +1080,7 @@ private void opNotWordBound() {
if (s == str) {
if (s < range && enc.isMbcWord(bytes, s, end)) {opFail(); return;}
} else if (s == end) {
if (enc.isMbcWord(bytes, sprev, end)) {opFail(); return;}
if (sprev < end && enc.isMbcWord(bytes, sprev, end)) {opFail(); return;}
} else {
if (enc.isMbcWord(bytes, s, end) != enc.isMbcWord(bytes, sprev, end)) {opFail(); return;}
}
Expand Down

0 comments on commit 64bcdcb

Please sign in to comment.