diff options
author | gm10 <[email protected]> | 2019-09-13 11:18:43 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-09-26 14:39:13 +0200 |
commit | 80f9fbca3e7a07679093d3f604a9c151c147dd1d (patch) | |
tree | 59620281610522abb2f3a763c6d248c9041237b3 /logview | |
parent | 3623a5aafd10aca56e1c45ae823e09337b65a240 (diff) | |
download | mate-utils-80f9fbca3e7a07679093d3f604a9c151c147dd1d.tar.bz2 mate-utils-80f9fbca3e7a07679093d3f604a9c151c147dd1d.tar.xz |
logview: Fix infinite loop parsing logs containing at least one line with a recognized date but not ending with one
Diffstat (limited to 'logview')
-rw-r--r-- | logview/src/logview-utils.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/logview/src/logview-utils.c b/logview/src/logview-utils.c index c8a61ed1..383cbfc2 100644 --- a/logview/src/logview-utils.c +++ b/logview/src/logview-utils.c @@ -234,10 +234,6 @@ log_read_dates (const char **buffer_lines, time_t current) break; } - if (date_string == NULL && i == n - 1) { - done = TRUE; - } - /* this will set the last line of the "old" log to either: * - "n - 1" if we can't find another date * - the line before the new date else. @@ -267,6 +263,9 @@ log_read_dates (const char **buffer_lines, time_t current) day->timestamp_len = timestamp_len; rangemin = i; rangemax = n - 1; + } else { + /* no other date found */ + done = TRUE; } } } |