less/backport-Fix-erroneous-EOF-calculation-when-F-command-is-inte.patch
fuanan 106665619f [Backport]less:[add]backport patches from upstream
(cherry picked from commit a8a5443922ca981d8dade16e8981f4f415a3f7cc)
2021-05-28 17:35:58 +08:00

26 lines
581 B
Diff

From 87599e930a055d5ee92630da8380ade18ebfa24c Mon Sep 17 00:00:00 2001
From: Mark Nudelman <markn@greenwoodsoftware.com>
Date: Sun, 10 May 2020 15:59:01 -0700
Subject: [PATCH] Fix erroneous EOF calculation when F command is interrupted.
---
ch.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/ch.c b/ch.c
index 062a8e9..a08651a 100644
--- a/ch.c
+++ b/ch.c
@@ -836,7 +836,8 @@ seekable(f)
public void
ch_set_eof(VOID_PARAM)
{
- ch_fsize = ch_fpos;
+ if (ch_fsize != NULL_POSITION && ch_fsize < ch_fpos)
+ ch_fsize = ch_fpos;
}
--
1.8.3.1