fix post-v590 regression in file-types check

Related: RHEL-40257
This commit is contained in:
Michal Hlavinka 2024-08-12 09:43:57 +02:00
parent 73b37ac69f
commit af3877d8f6
2 changed files with 28 additions and 1 deletions

20
less-661-pipefix.patch Normal file
View File

@ -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)

View File

@ -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 <mhlavink@redhat.com> - 661-2
- fix post-v590 regression in file-types check
* Fri Jul 26 2024 Michal Hlavinka <mhlavink@redhat.com> - 661-1
- fix static analysis findigs (RHEL-40257)
- updated to 661