sysutils/lnav: Update to 0.10.1

PR:	258847
This commit is contained in:
Thomas Hurst 2021-10-29 09:40:05 -07:00 committed by Neel Chauhan
parent ad576dc65e
commit fb07233b04
3 changed files with 4 additions and 41 deletions

View file

@ -1,7 +1,7 @@
# Created by: Thomas Hurst <tom@hur.st>
PORTNAME= lnav
PORTVERSION= 0.9.0
PORTVERSION= 0.10.1
CATEGORIES= sysutils
MASTER_SITES= https://github.com/tstack/${PORTNAME}/releases/download/v${PORTVERSION}/

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1601099244
SHA256 (lnav-0.9.0.tar.bz2) = 9ba2c9c745d1479ec0eed0201cba7fdb223fc0489c50b20a54af3d2a1b2ae550
SIZE (lnav-0.9.0.tar.bz2) = 877288
TIMESTAMP = 1633398666
SHA256 (lnav-0.10.1.tar.bz2) = 3bb0fb4f36efc1b83f082b0a232fd4495fc78dcf552424afcb0297d21613b3a7
SIZE (lnav-0.10.1.tar.bz2) = 1400364

View file

@ -1,37 +0,0 @@
--- src/logfile.cc.orig 2020-09-09 16:17:12 UTC
+++ src/logfile.cc
@@ -323,10 +323,13 @@ logfile::rebuild_result_t logfile::rebuild_index()
this->lf_line_buffer.clear();
if (!this->lf_index.empty()) {
- off_t check_line_off = this->lf_index.back().get_offset();
+ auto last_line = this->lf_index.end();
+ --last_line;
+ off_t check_line_off = last_line->get_offset();
+ auto last_length = ssize_t(this->line_length(last_line, false));
auto read_result = this->lf_line_buffer.read_range({
- check_line_off, this->lf_index_size - check_line_off
+ check_line_off, last_length
});
if (read_result.isErr()) {
@@ -553,7 +556,7 @@ filesystem::path logfile::get_path() const
size_t logfile::line_length(logfile::iterator ll, bool include_continues)
{
- iterator next_line = ll;
+ auto next_line = ll;
size_t retval;
if (!include_continues && this->lf_next_line_cache) {
@@ -570,6 +573,9 @@ size_t logfile::line_length(logfile::iterator ll, bool
if (next_line == this->end()) {
retval = this->lf_index_size - ll->get_offset();
+ if (retval > line_buffer::MAX_LINE_BUFFER_SIZE) {
+ retval = line_buffer::MAX_LINE_BUFFER_SIZE;
+ }
if (retval > 0 && !this->lf_partial_line) {
retval -= 1;
}