The branch stable/13 has been updated by delphij:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4266bc4fcf9b46565f20e46f12ccd2afec9c0734

commit 4266bc4fcf9b46565f20e46f12ccd2afec9c0734
Author:     Xin LI <delp...@freebsd.org>
AuthorDate: 2025-07-20 17:33:52 +0000
Commit:     Xin LI <delp...@freebsd.org>
CommitDate: 2025-08-03 01:00:44 +0000

    MFC: MFV: less v679.
    
    (cherry picked from commit 76bafc90692608c1db8df3276e966212201c270c)
---
 contrib/less/NEWS         | 10 ++++++++++
 contrib/less/decode.c     |  2 +-
 contrib/less/help.c       |  2 +-
 contrib/less/less.h       |  9 +++++----
 contrib/less/less.nro     |  2 +-
 contrib/less/lessecho.nro |  2 +-
 contrib/less/lesskey.nro  |  2 +-
 contrib/less/os.c         |  6 +++---
 contrib/less/version.c    |  4 +++-
 9 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/contrib/less/NEWS b/contrib/less/NEWS
index 5767ded21a00..cdc8196a5f16 100644
--- a/contrib/less/NEWS
+++ b/contrib/less/NEWS
@@ -9,6 +9,16 @@
   Report bugs, suggestions or comments at 
   https://github.com/gwsw/less/issues.
 
+======================================================================
+
+       Major changes between "less" versions 678 and 679
+
+* Fix bad parsing of lesskey file an env var is a prefix of another
+  env var (github #626).
+
+* Fix unexpected exit using -K if a key press is received while reading
+  the input file (github #628).
+
 ======================================================================
 
        Major changes between "less" versions 668 and 678
diff --git a/contrib/less/decode.c b/contrib/less/decode.c
index 2942a30863cb..8e451d1810c9 100644
--- a/contrib/less/decode.c
+++ b/contrib/less/decode.c
@@ -750,7 +750,7 @@ static int cmd_search(constant char *cmd, constant unsigned 
char *table, constan
                        {
                                action = taction;
                                *extra = textra;
-                       } else if (match > 0) /* cmd is a prefix of this table 
entry */
+                       } else if (match > 0 && action == A_INVALID) /* cmd is 
a prefix of this table entry */
                        {
                                action = A_PREFIX;
                        }
diff --git a/contrib/less/help.c b/contrib/less/help.c
index 81e0943fe4e2..5d8ba9a1b0fe 100644
--- a/contrib/less/help.c
+++ b/contrib/less/help.c
@@ -1,4 +1,4 @@
-/* This file was generated by mkhelp.pl from less.hlp at 20:41 on 2025/5/1 */
+/* This file was generated by mkhelp.pl from less.hlp at 19:46 on 2025/5/28 */
 #include "less.h"
 constant char helpdata[] = {
 '\n',
diff --git a/contrib/less/less.h b/contrib/less/less.h
index 94a3e2235906..7b2d2c25bfc6 100644
--- a/contrib/less/less.h
+++ b/contrib/less/less.h
@@ -575,10 +575,11 @@ typedef enum {
 #endif
 #endif
 
-#define S_INTERRUPT     01
-#define S_STOP          02
-#define S_WINCH         04
-#define ABORT_SIGS()    (sigs & (S_INTERRUPT|S_STOP))
+#define S_INTERRUPT     (1<<0)
+#define S_SWINTERRUPT   (1<<1)
+#define S_STOP          (1<<2)
+#define S_WINCH         (1<<3)
+#define ABORT_SIGS()    (sigs & (S_INTERRUPT|S_SWINTERRUPT|S_STOP))
 
 #ifdef EXIT_SUCCESS
 #define QUIT_OK         EXIT_SUCCESS
diff --git a/contrib/less/less.nro b/contrib/less/less.nro
index 6b74ec5f161b..25a9869a9c59 100644
--- a/contrib/less/less.nro
+++ b/contrib/less/less.nro
@@ -1,5 +1,5 @@
 '\" t
-.TH LESS 1 "Version 678: 01 May 2025"
+.TH LESS 1 "Version 679: 28 May 2025"
 .SH NAME
 less \- display the contents of a file in a terminal
 .SH SYNOPSIS
diff --git a/contrib/less/lessecho.nro b/contrib/less/lessecho.nro
index 696fcb13b214..f0cccc4de6da 100644
--- a/contrib/less/lessecho.nro
+++ b/contrib/less/lessecho.nro
@@ -1,4 +1,4 @@
-.TH LESSECHO 1 "Version 678: 01 May 2025"
+.TH LESSECHO 1 "Version 679: 28 May 2025"
 .SH NAME
 lessecho \- expand metacharacters
 .SH SYNOPSIS
diff --git a/contrib/less/lesskey.nro b/contrib/less/lesskey.nro
index 61ba056b04c6..0a17c9deff71 100644
--- a/contrib/less/lesskey.nro
+++ b/contrib/less/lesskey.nro
@@ -1,5 +1,5 @@
 '\" t
-.TH LESSKEY 1 "Version 678: 01 May 2025"
+.TH LESSKEY 1 "Version 679: 28 May 2025"
 .SH NAME
 lesskey \- customize key bindings for less
 .SH "SYNOPSIS (deprecated)"
diff --git a/contrib/less/os.c b/contrib/less/os.c
index 98a7ecf70c3c..357cbb356a16 100644
--- a/contrib/less/os.c
+++ b/contrib/less/os.c
@@ -275,7 +275,7 @@ start:
                if (ret != 0)
                {
                        if (ret == READ_INTR)
-                               sigs |= S_INTERRUPT;
+                               sigs |= S_SWINTERRUPT;
                        reading = FALSE;
                        return (ret);
                }
@@ -287,7 +287,7 @@ start:
                int c;
 
                c = WIN32getch();
-               sigs |= S_INTERRUPT;
+               sigs |= S_SWINTERRUPT;
                reading = FALSE;
                if (c != CONTROL('C') && c != intr_char)
                        WIN32ungetch((char) c);
@@ -348,7 +348,7 @@ public int iopen(constant char *filename, int flags)
        while (!opening && SET_JUMP(open_label))
        {
                opening = FALSE;
-               if (sigs & S_INTERRUPT)
+               if (sigs & (S_INTERRUPT|S_SWINTERRUPT))
                {
                        sigs = 0;
 #if HAVE_SETTABLE_ERRNO
diff --git a/contrib/less/version.c b/contrib/less/version.c
index 9a97f1658940..68a42a6272fa 100644
--- a/contrib/less/version.c
+++ b/contrib/less/version.c
@@ -1047,6 +1047,8 @@ v675  4/3/25    Add ESC-b.
 v676  4/16/25   Fix two OSC 8 display bugs.
 v677  4/27/25   Fix & filtering bug.
 v678  5/1/25    Don't change stty tab setting.
+v679  5/28/25   Fix lesskey parsing bug when env var is prefix of another;
+                fix unexpected exit when using -K.
 */
 
-char version[] = "678";
+char version[] = "679";

Reply via email to