*
* Copyright (C) 2012, 2013 Eric Biggers
*
- * This file is part of wimlib, a library for working with WIM files.
+ * This file is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at your option) any
+ * later version.
*
- * wimlib is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 3 of the License, or (at your option)
- * any later version.
- *
- * wimlib is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * This file is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
- * You should have received a copy of the GNU General Public License
- * along with wimlib; if not, see http://www.gnu.org/licenses/.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this file; if not, see http://www.gnu.org/licenses/.
*/
u8 *window_end = &window[window_size];
unsigned sym;
unsigned match_len;
- unsigned offset_bsr;
+ unsigned offset_high_bit;
unsigned match_offset;
while (window_ptr != window_end) {
/* Match */
match_len = sym & 0xf;
- offset_bsr = (sym >> 4) & 0xf;
+ offset_high_bit = (sym >> 4) & 0xf;
bitstream_ensure_bits(istream, 16);
- match_offset = (1 << offset_bsr) |
- bitstream_pop_bits(istream, offset_bsr);
+ match_offset = (1 << offset_high_bit) |
+ bitstream_pop_bits(istream, offset_high_bit);
if (match_len == 0xf) {
match_len += bitstream_read_byte(istream);
if (unlikely(match_len > window_end - window_ptr))
return -1;
- lz_copy(window_ptr, match_len, match_offset, window_end);
+ lz_copy(window_ptr, match_len, match_offset, window_end,
+ XPRESS_MIN_MATCH_LEN);
window_ptr += match_len;
}