Skip to content

Commit

Permalink
Merge pull request #692 from mjmst74/master
Browse files Browse the repository at this point in the history
Update Deflate.java
  • Loading branch information
mwiede authored Oct 30, 2024
2 parents 4f2e3fe + f077dde commit 42ab7f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/jcraft/jsch/jzlib/Deflate.java
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,9 @@ int longest_match(int cur_match) {
&& window[++scan] == window[++match] && window[++scan] == window[++match]
&& scan < strend);

len = MAX_MATCH - strend - scan;
// len here is set to MAX_MATCH minus (strend minus scan, i.e. the distance between scan and
// strend) to ensure that best_len is set to the best possible length to lookahead
len = MAX_MATCH - (strend - scan);
scan = strend - MAX_MATCH;

if (len > best_len) {
Expand Down

0 comments on commit 42ab7f3

Please sign in to comment.