From d6f12f30c1c41955a87b632cea5d3f2b6141643b Mon Sep 17 00:00:00 2001 From: zhangxingrong Date: Sat, 11 May 2024 16:02:33 +0800 Subject: [PATCH] Move any_data under #if USE_POLL and ensure that tty variable --- backport-Fixed-typo.patch | 22 ++++++++++ ...SE_POLL-and-ensure-that-tty-variable.patch | 41 +++++++++++++++++++ less.spec | 7 +++- 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 backport-Fixed-typo.patch create mode 100644 backport-Move-any_data-under-if-USE_POLL-and-ensure-that-tty-variable.patch diff --git a/backport-Fixed-typo.patch b/backport-Fixed-typo.patch new file mode 100644 index 0000000..19be9e6 --- /dev/null +++ b/backport-Fixed-typo.patch @@ -0,0 +1,22 @@ +From 7a0cb4dcab040a4274e9d0d1301c7e925ba9ca18 Mon Sep 17 00:00:00 2001 +From: Stefan +Date: Mon, 29 May 2023 19:23:01 +0200 +Subject: [PATCH] Fixed typo (#366) + +--- + screen.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/screen.c b/screen.c +index b76a4ea2..1e97c66e 100644 +--- a/screen.c ++++ b/screen.c +@@ -1702,7 +1702,7 @@ static void ltputs(char *str, int affcnt, int (*f_putc)(int)) + #endif /* MSDOS_COMPILER */ + + /* +- * Configure the termimal so mouse clicks and wheel moves ++ * Configure the terminal so mouse clicks and wheel moves + * produce input to less. + */ + public void init_mouse(void) diff --git a/backport-Move-any_data-under-if-USE_POLL-and-ensure-that-tty-variable.patch b/backport-Move-any_data-under-if-USE_POLL-and-ensure-that-tty-variable.patch new file mode 100644 index 0000000..d93a28f --- /dev/null +++ b/backport-Move-any_data-under-if-USE_POLL-and-ensure-that-tty-variable.patch @@ -0,0 +1,41 @@ +From bd05d5102880eca0ea2a1f1f713dd2e568bc164c Mon Sep 17 00:00:00 2001 +From: Mark Nudelman +Date: Mon, 29 May 2023 10:20:38 -0700 +Subject: [PATCH] Move any_data under #if USE_POLL and ensure that tty variable + is not accessed when it does not exist (in MSDOS build). + +--- + os.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/os.c b/os.c +index 0edc859f..b9097c41 100644 +--- a/os.c ++++ b/os.c +@@ -48,6 +48,7 @@ static int use_poll = TRUE; + #endif + #if USE_POLL + #include ++static int any_data = FALSE; + #endif + + /* +@@ -72,7 +73,6 @@ public int consecutive_nulls = 0; + /* Milliseconds to wait for data before displaying "waiting for data" message. */ + static int waiting_for_data_delay = 4000; + static jmp_buf read_label; +-static int any_data = FALSE; + + extern int sigs; + extern int ignore_eoi; +@@ -292,8 +292,10 @@ public int iread(int fd, unsigned char *buf, unsigned int len) + #endif + return (READ_ERR); + } ++#if USE_POLL + if (fd != tty && n > 0) + any_data = TRUE; ++#endif + return (n); + } + diff --git a/less.spec b/less.spec index bffd447..8248f9a 100644 --- a/less.spec +++ b/less.spec @@ -1,6 +1,6 @@ Name: less Version: 633 -Release: 3 +Release: 4 Summary: Less is a pager that displays text files. License: GPLv3+ or BSD URL: http://www.greenwoodsoftware.com/less @@ -13,6 +13,8 @@ Patch4: backport-CVE-2024-32487.patch Patch5: backport-Don-t-return-READ_AGAIN-from-iread-if-no-data-has-ye.patch Patch6: backport-Fix-for-previous-fix.patch Patch7: backport-Avoid-stealing-data-from-an-input-program-that-uses-.patch +Patch8: backport-Fixed-typo.patch +Patch9: backport-Move-any_data-under-if-USE_POLL-and-ensure-that-tty-variable.patch BuildRequires: gcc make ncurses-devel autoconf automake libtool @@ -51,6 +53,9 @@ autoreconf -ivf %{_mandir}/man1/* %changelog +* Sat May 11 2024 zhangxingrong - 633-4 +- backport some upstream patch + * Mon Apr 29 2024 huyubiao - 633-3 - fix problem when a program piping into less reads from the tty, like sudo asking for password -- Gitee