From af3877d8f6919b785bc0864f3da7cbf8207ef80b Mon Sep 17 00:00:00 2001 From: Michal Hlavinka Date: Mon, 12 Aug 2024 09:43:57 +0200 Subject: [PATCH] fix post-v590 regression in file-types check Related: RHEL-40257 --- less-661-pipefix.patch | 20 ++++++++++++++++++++ less.spec | 9 ++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 less-661-pipefix.patch diff --git a/less-661-pipefix.patch b/less-661-pipefix.patch new file mode 100644 index 0000000..e82d2e1 --- /dev/null +++ b/less-661-pipefix.patch @@ -0,0 +1,20 @@ +diff -up less-661/os.c.pipefix less-661/os.c +--- less-661/os.c.pipefix 2024-06-29 19:16:08.000000000 +0200 ++++ less-661/os.c 2024-08-10 08:06:14.762224766 +0200 +@@ -80,6 +80,7 @@ extern int exit_F_on_close; + extern int follow_mode; + extern int scanning_eof; + extern char intr_char; ++extern int is_tty; + #if !MSDOS_COMPILER + extern int tty; + #endif +@@ -237,7 +238,7 @@ start: + } + #endif + #if USE_POLL +- if (fd != tty && use_poll) ++ if (is_tty && fd != tty && use_poll) + { + int ret = check_poll(fd, tty); + if (ret != 0) diff --git a/less.spec b/less.spec index 8c78874..5f7a435 100644 --- a/less.spec +++ b/less.spec @@ -1,7 +1,7 @@ Summary: A text file browser similar to more, but better Name: less Version: 661 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL-3.0-only AND BSD-2-Clause Source0: https://www.greenwoodsoftware.com/less/%{name}-%{version}.tar.gz Source1: lesspipe.sh @@ -16,6 +16,9 @@ Patch10: less-458-lesskey-usage.patch Patch11: less-458-old-bot-in-help.patch Patch12: less-436-help.patch Patch13: less-661-fix_sast.patch +# from upstream, for <=661, fixes regression in file-types sanity chack post v590 +# https://github.com/gwsw/less/commit/ed454a217da417dc052723ea70da8efde0f2e66c +Patch14: less-661-pipefix.patch URL: https://www.greenwoodsoftware.com/less/ BuildRequires: ncurses-devel BuildRequires: autoconf automake libtool @@ -42,6 +45,7 @@ files, and you'll use it frequently. %patch -P 11 -p1 -b .old-bot %patch -P 12 -p1 -b .help %patch -P 13 -p1 -b .fix_sast +%patch -P 14 -p1 -b .pipefix %build @@ -65,6 +69,9 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/profile.d %{_mandir}/man1/* %changelog +* Sat Aug 10 2024 Michal Hlavinka - 661-2 +- fix post-v590 regression in file-types check + * Fri Jul 26 2024 Michal Hlavinka - 661-1 - fix static analysis findigs (RHEL-40257) - updated to 661