Because it's on my OpenBSD ports list[1]. Please find below an update diff
to the latest stable screen version.

Build tested with base clang, base gcc and ports gcc with all FLAVORS.
Only lightly runtime tested with all FLAVORS on amd64 .

Tests welcome and also OKs/Feedback.

RS

[1]:
https://www.sizeofvoid.org/posts/2018-03-25-ports-wishlist-for-the-release-6-3-6-4/

Index: Makefile
===================================================================
RCS file: /cvs/ports/misc/screen/Makefile,v
retrieving revision 1.68
diff -u -p -u -p -r1.68 Makefile
--- Makefile    1 Sep 2015 12:05:19 -0000       1.68
+++ Makefile    27 Feb 2019 02:39:40 -0000
@@ -3,24 +3,24 @@
 
 COMMENT=       multi-screen window manager
 
-VERSION=       4.0.3
+VERSION=       4.6.2
 DISTNAME=      screen-${VERSION}
-REVISION=      6
 CATEGORIES=    misc
 MASTER_SITES=  ${MASTER_SITE_GNU:=screen/}
 
 HOMEPAGE=      https://www.gnu.org/software/screen/
 
-# GPLv2+
+# GPLv3+
 PERMIT_PACKAGE_CDROM=  Yes
 
 SUBST_VARS=    VERSION
 
 CFLAGS+=       -Wall
 
-CONFIGURE_STYLE= gnu
-CONFIGURE_ARGS=        --with-sys-screenrc="${SYSCONFDIR}/screenrc"
-USE_GROFF =    Yes
+CONFIGURE_STYLE=       gnu
+CONFIGURE_ARGS=                --with-sys-screenrc="${SYSCONFDIR}/screenrc"
+USE_GROFF=             Yes
+USE_GMAKE=             Yes
 
 FLAVORS=       static shm
 FLAVOR?=
Index: distinfo
===================================================================
RCS file: /cvs/ports/misc/screen/distinfo,v
retrieving revision 1.11
diff -u -p -u -p -r1.11 distinfo
--- distinfo    18 Jan 2015 03:14:33 -0000      1.11
+++ distinfo    27 Feb 2019 02:39:40 -0000
@@ -1,2 +1,2 @@
-SHA256 (screen-4.0.3.tar.gz) = ePDVsUlghKWQJYYwTUpzlUsr/jPqE+3O7PIWFcOebHc=
-SIZE (screen-4.0.3.tar.gz) = 840602
+SHA256 (screen-4.6.2.tar.gz) = G2kiUg5qDOXih2jWILD2QKZjE5f5XMsEO3C5G7UD+jo=
+SIZE (screen-4.6.2.tar.gz) = 845210
Index: patches/patch-ansi_c
===================================================================
RCS file: patches/patch-ansi_c
diff -N patches/patch-ansi_c
--- patches/patch-ansi_c        11 Sep 2015 14:04:59 -0000      1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,43 +0,0 @@
-$OpenBSD: patch-ansi_c,v 1.4 2015/09/11 14:04:59 jasper Exp $
-
-Security fix for CVE-2015-6806,
-screen: Stack overflow due to deep recursion causing process freeze
-
---- ansi.c.orig        Fri Dec  5 14:57:05 2003
-+++ ansi.c     Tue Sep  1 14:03:33 2015
-@@ -2425,13 +2425,13 @@ int n, ys, ye, bce;
-     return;
-   if (n > 0)
-     {
-+      if (ye - ys + 1 < n)
-+      n = ye - ys + 1;
-       if (n > 256)
-       {
-         MScrollV(p, n - 256, ys, ye, bce);
-         n = 256;
-       }
--      if (ye - ys + 1 < n)
--      n = ye - ys + 1;
- #ifdef COPY_PASTE
-       if (compacthist)
-       {
-@@ -2482,14 +2482,14 @@ int n, ys, ye, bce;
-     }
-   else
-     {
--      if (n < -256)
--      {
--        MScrollV(p, n + 256, ys, ye, bce);
--        n = -256;
--      }
-       n = -n;
-       if (ye - ys + 1 < n)
-       n = ye - ys + 1;
-+      if (n > 256)
-+      {
-+        MScrollV(p, - (n - 256), ys, ye, bce);
-+        n = 256;
-+      }
- 
-       ml = p->w_mlines + ye;
-       /* Clear lines */
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- patches/patch-configure     31 Oct 2006 18:01:01 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,17 +0,0 @@
-$OpenBSD: patch-configure,v 1.1 2006/10/31 18:01:01 naddy Exp $
---- configure.orig     Mon Oct 30 17:48:42 2006
-+++ configure  Mon Oct 30 17:49:09 2006
-@@ -7186,10 +7186,12 @@ cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
- 
-+#include <stdarg.h>
- int
- main ()
- {
--vsprintf(0,0,0);
-+va_list ap;
-+vsprintf(0,0,ap);
-   ;
-   return 0;
- }
Index: patches/patch-doc_screen_1
===================================================================
RCS file: /cvs/ports/misc/screen/patches/patch-doc_screen_1,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 patch-doc_screen_1
--- patches/patch-doc_screen_1  26 Sep 2003 23:50:55 -0000      1.4
+++ patches/patch-doc_screen_1  27 Feb 2019 02:39:40 -0000
@@ -1,16 +1,17 @@
 $OpenBSD: patch-doc_screen_1,v 1.4 2003/09/26 23:50:55 brad Exp $
---- doc/screen.1.orig  2003-08-27 16:36:21.000000000 +0200
-+++ doc/screen.1       2003-09-12 15:36:35.000000000 +0200
-@@ -99,7 +99,7 @@ create the new window.
- The above example would start the emacs editor (editing prog.c) and switch
- to its window.
+Index: doc/screen.1
+--- doc/screen.1.orig
++++ doc/screen.1
+@@ -103,7 +103,7 @@ to its window. - Note that you cannot transport enviro
+ the invoking shell to the application (emacs in this case), because it is
+ forked from the parent screen process, not from the invoking shell.
  .PP
 -If \*Q/etc/utmp\*U is writable by
 +If \*Q/var/run/utmp\*U is writable by
  .IR screen ,
  an appropriate record will be written to this file for each window, and
  removed when the window is terminated.
-@@ -228,7 +228,7 @@ See the \*Qdefflow\*U .screenrc command 
+@@ -232,7 +232,7 @@ See the \*Qdefflow\*U .screenrc command for details.
  The use of this option is discouraged.
  .TP 5
  .BR \-l " and " \-ln
@@ -18,41 +19,17 @@ $OpenBSD: patch-doc_screen_1,v 1.4 2003/
 +turns login mode on or off (for /var/run/utmp updating).
  This can also be defined through the \*Qdeflogin\*U .screenrc command.
  .TP 5
- .BR \-ls " and " \-list
-@@ -594,7 +594,7 @@ in the environment variable $SCREENDIR.
+ .BR \-ls " [" \fImatch ]
+@@ -725,7 +725,7 @@ in the environment variable $SCREENDIR.
  When
  .I screen
  is invoked, it executes initialization commands from the files
 -\*Q/usr/local/etc/screenrc\*U and
-+\*Q!!sysconfdir!!/screenrc\*U and
++\*Q/etc/screenrc\*U and
  \*Q.screenrc\*U in the user's home directory. These are the \*Qprogrammer's
  defaults\*U that can be overridden in the following ways: for the
  global screenrc file 
-@@ -1669,7 +1669,7 @@ and then compile the entry with 
- The echo command may be used to annoy 
- .I screen
- users with a 'message of the
--day'. Typically installed in a global /local/etc/screenrc. 
-+day'. Typically installed in a global !!sysconfdir!!/screenrc. 
- The option \*Q-n\*U may be used to suppress the line feed.
- See also \*Qsleep\*U.
- Echo is also useful for online checking of environment variables.
-@@ -4416,12 +4416,12 @@ Examples in the 
- .I screen
- distribution package for private and global initialization files.
- .IP $SYSSCREENRC 
--.IP /usr/local/etc/screenrc
-+.IP !!sysconfdir!!/screenrc
- .I screen
- initialization commands
- .IP $SCREENRC
- .IP $HOME/.screenrc
--Read in after /usr/local/etc/screenrc
-+Read in after !!sysconfdir!!/screenrc
- .IP $SCREENDIR/S-<login>
- .IP /local/screens/S-<login>
- Socket directories (default)
-@@ -4442,7 +4442,7 @@ Output log files created by the log func
+@@ -5113,7 +5113,7 @@ Output log files created by the log function
  or
  .IP /etc/termcap
  Terminal capability databases
@@ -61,7 +38,7 @@ $OpenBSD: patch-doc_screen_1,v 1.4 2003/
  Login records
  .IP $LOCKPRG
  Program that locks a terminal.
-@@ -4555,9 +4555,9 @@ does not make use of hardware tabs.
+@@ -5235,9 +5235,9 @@ does not make use of hardware tabs.
  must be installed as set-uid with owner root on most systems in order
  to be able to correctly change the owner of the tty device file for
  each window.
Index: patches/patch-extern_h
===================================================================
RCS file: patches/patch-extern_h
diff -N patches/patch-extern_h
--- patches/patch-extern_h      23 Mar 2012 21:37:50 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-$OpenBSD: patch-extern_h,v 1.1 2012/03/23 21:37:50 naddy Exp $
---- extern.h.orig      Fri Mar 23 22:26:34 2012
-+++ extern.h   Fri Mar 23 22:27:04 2012
-@@ -146,7 +146,9 @@ extern void  CloseDevice __P((struct win *));
- #ifdef ZMODEM
- extern void  zmodem_abort __P((struct win *, struct display *));
- #endif
-+#if 0
- extern void  execvpe __P((char *, char **, char **));
-+#endif
- 
- /* utmp.c */
- #ifdef UTMPOK
Index: patches/patch-fileio_c
===================================================================
RCS file: patches/patch-fileio_c
diff -N patches/patch-fileio_c
--- patches/patch-fileio_c      23 Mar 2012 21:37:50 -0000      1.2
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-fileio_c,v 1.2 2012/03/23 21:37:50 naddy Exp $
---- fileio.c.orig      Mon Sep  8 16:25:28 2003
-+++ fileio.c   Fri Mar 23 22:27:59 2012
-@@ -779,7 +779,7 @@ char *cmd;
- #ifdef SIGPIPE
-       signal(SIGPIPE, SIG_DFL);
- #endif
--      execl("/bin/sh", "sh", "-c", cmd, 0);
-+      execl("/bin/sh", "sh", "-c", cmd, NULL);
-       Panic(errno, "/bin/sh");
-     default:
-       break;
Index: patches/patch-pty_c
===================================================================
RCS file: patches/patch-pty_c
diff -N patches/patch-pty_c
--- patches/patch-pty_c 5 Jan 2004 02:00:54 -0000       1.3
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
-$OpenBSD: patch-pty_c,v 1.3 2004/01/05 02:00:54 brad Exp $
---- pty.c.orig 2003-09-08 10:26:18.000000000 -0400
-+++ pty.c      2004-01-04 21:00:15.000000000 -0500
-@@ -25,6 +25,7 @@
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <signal.h>
-+#include <util.h>
- 
- #include "config.h"
- #include "screen.h"
Index: patches/patch-window_c
===================================================================
RCS file: patches/patch-window_c
diff -N patches/patch-window_c
--- patches/patch-window_c      23 Mar 2012 21:37:50 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-$OpenBSD: patch-window_c,v 1.1 2012/03/23 21:37:50 naddy Exp $
---- window.c.orig      Fri Mar 23 22:25:23 2012
-+++ window.c   Fri Mar 23 22:26:20 2012
-@@ -1387,6 +1387,7 @@ char **args, *ttyn;
-   return pid;
- }
- 
-+#if 0
- void
- execvpe(prog, args, env)
- char *prog, **args, **env;
-@@ -1432,6 +1433,7 @@ char *prog, **args, **env;
-   if (eaccess)
-     errno = EACCES;
- }
-+#endif
- 
- #ifdef PSEUDOS
- 
Index: patches/shmpatch-Makefile_in
===================================================================
RCS file: /cvs/ports/misc/screen/patches/shmpatch-Makefile_in,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 shmpatch-Makefile_in
--- patches/shmpatch-Makefile_in        22 Nov 2003 00:56:58 -0000      1.1
+++ patches/shmpatch-Makefile_in        27 Feb 2019 02:39:40 -0000
@@ -1,7 +1,8 @@
 $OpenBSD: shmpatch-Makefile_in,v 1.1 2003/11/22 00:56:58 espie Exp $
---- Makefile.in.orig   2003-09-18 18:13:02.000000000 +0200
-+++ Makefile.in        2003-11-17 23:37:54.000000000 +0100
-@@ -46,7 +46,12 @@ AWK = @AWK@
+Index: Makefile.in
+--- Makefile.in.orig
++++ Makefile.in
+@@ -55,7 +55,12 @@ AWK = @AWK@
  # -DDUMPSHADOW
  #     With shadow-pw screen would never dump core. Use this option if
  #     you still want to have a core. Use only for debugging.
Index: patches/shmpatch-configure_in
===================================================================
RCS file: patches/shmpatch-configure_in
diff -N patches/shmpatch-configure_in
--- patches/shmpatch-configure_in       22 Nov 2003 00:56:58 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,32 +0,0 @@
-$OpenBSD: shmpatch-configure_in,v 1.1 2003/11/22 00:56:58 espie Exp $
---- configure.in.orig  2003-06-03 13:58:24.000000000 +0200
-+++ configure.in       2003-11-17 23:37:54.000000000 +0100
-@@ -1193,17 +1193,17 @@ main() {
-   exit(0); /* libc version works properly.  */
- }], AC_DEFINE(USEMEMCPY))
- 
--AC_MSG_CHECKING(long file names)
--(echo 1 > /tmp/conftest9012345) 2>/dev/null
--(echo 2 > /tmp/conftest9012346) 2>/dev/null
--val=`cat /tmp/conftest9012345 2>/dev/null`
--if test -f /tmp/conftest9012345 && test "$val" = 1; then
--AC_MSG_RESULT(yes)
--else
--AC_MSG_RESULT(no)
--AC_DEFINE(NAME_MAX, 14)
--fi
--rm -f /tmp/conftest*
-+#AC_MSG_CHECKING(long file names)
-+#(echo 1 > /tmp/conftest9012345) 2>/dev/null
-+#(echo 2 > /tmp/conftest9012346) 2>/dev/null
-+#val=`cat /tmp/conftest9012345 2>/dev/null`
-+#if test -f /tmp/conftest9012345 && test "$val" = 1; then
-+#AC_MSG_RESULT(yes)
-+#else
-+#AC_MSG_RESULT(no)
-+#AC_DEFINE(NAME_MAX, 14)
-+#fi
-+#rm -f /tmp/conftest*
- 
- AC_MSG_CHECKING(for vsprintf)
- AC_TRY_LINK(,[vsprintf(0,0,0);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), 
AC_MSG_RESULT(no))
Index: patches/shmpatch-extern_h
===================================================================
RCS file: /cvs/ports/misc/screen/patches/shmpatch-extern_h,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 shmpatch-extern_h
--- patches/shmpatch-extern_h   22 Nov 2003 00:56:58 -0000      1.1
+++ patches/shmpatch-extern_h   27 Feb 2019 02:39:40 -0000
@@ -1,7 +1,8 @@
 $OpenBSD: shmpatch-extern_h,v 1.1 2003/11/22 00:56:58 espie Exp $
---- extern.h.orig      2003-08-22 14:27:57.000000000 +0200
-+++ extern.h   2003-11-17 23:37:54.000000000 +0100
-@@ -139,6 +139,11 @@ extern int   winexec __P((char **));
+Index: extern.h
+--- extern.h.orig
++++ extern.h
+@@ -155,6 +155,11 @@ extern int   winexec __P((char **));
  extern void  FreePseudowin __P((struct win *));
  #endif
  extern void  nwin_compose __P((struct NewWindow *, struct NewWindow *, struct 
NewWindow *));
Index: patches/shmpatch-sched_c
===================================================================
RCS file: /cvs/ports/misc/screen/patches/shmpatch-sched_c,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 shmpatch-sched_c
--- patches/shmpatch-sched_c    22 Nov 2003 00:56:58 -0000      1.1
+++ patches/shmpatch-sched_c    27 Feb 2019 02:39:40 -0000
@@ -1,7 +1,8 @@
 $OpenBSD: shmpatch-sched_c,v 1.1 2003/11/22 00:56:58 espie Exp $
---- sched.c.orig       2003-09-08 16:26:36.000000000 +0200
-+++ sched.c    2003-11-17 23:37:54.000000000 +0100
-@@ -110,6 +110,10 @@ calctimo()
+Index: sched.c
+--- sched.c.orig
++++ sched.c
+@@ -115,6 +115,10 @@ calctimo()
    return min;
  }
  
@@ -12,7 +13,7 @@ $OpenBSD: shmpatch-sched_c,v 1.1 2003/11
  void
  sched()
  {
-@@ -121,6 +125,11 @@ sched()
+@@ -126,6 +130,11 @@ sched()
  
    for (;;)
      {
Index: patches/shmpatch-screen_c
===================================================================
RCS file: /cvs/ports/misc/screen/patches/shmpatch-screen_c,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 shmpatch-screen_c
--- patches/shmpatch-screen_c   22 Nov 2003 00:56:58 -0000      1.1
+++ patches/shmpatch-screen_c   27 Feb 2019 02:39:40 -0000
@@ -1,7 +1,8 @@
 $OpenBSD: shmpatch-screen_c,v 1.1 2003/11/22 00:56:58 espie Exp $
---- screen.c.orig      2003-09-08 16:26:41.000000000 +0200
-+++ screen.c   2003-11-17 23:37:54.000000000 +0100
-@@ -71,6 +71,14 @@
+Index: screen.c
+--- screen.c.orig
++++ screen.c
+@@ -88,6 +88,14 @@
  #if (defined(AUX) || defined(_AUX_SOURCE)) && defined(POSIX)
  # include <compat.h>
  #endif
@@ -16,7 +17,7 @@ $OpenBSD: shmpatch-screen_c,v 1.1 2003/1
  #if defined(USE_LOCALE) || defined(ENCODINGS)
  # include <locale.h>
  #endif
-@@ -78,6 +86,11 @@
+@@ -95,6 +103,11 @@
  # include <langinfo.h>
  #endif
  
@@ -28,9 +29,9 @@ $OpenBSD: shmpatch-screen_c,v 1.1 2003/1
  #include "screen.h"
  #ifdef HAVE_BRAILLE
  # include "braille.h"
-@@ -234,6 +247,12 @@ struct win *console_window;
- 
- 
+@@ -263,6 +276,12 @@ struct win *console_window;
+ int af;
+ #endif
  
 +
 +#ifdef IPC_EXPORT_IMAGE
@@ -41,10 +42,12 @@ $OpenBSD: shmpatch-screen_c,v 1.1 2003/1
  /*
   * Do this last
   */
-@@ -461,6 +480,37 @@ char **av;
+@@ -486,6 +505,37 @@ int main(int ac, char** av)
+ #ifdef ZMODEM
+   zmodem_sendcmd = SaveStr("!!! sz -vv -b ");
    zmodem_recvcmd = SaveStr("!!! rz -vv -b -E");
- #endif
- 
++#endif
++
 +#ifdef IPC_EXPORT_IMAGE
 +  {
 +    key_t key = 0xBACD072F;     /* random static IPC key */
@@ -74,8 +77,6 @@ $OpenBSD: shmpatch-screen_c,v 1.1 2003/1
 +    strcpy( shm+4, "screen is initializing..." );
 +    memset( shm+4+strlen(shm+4), ' ', 80);
 +  }
-+#endif
-+
- #ifdef COPY_PASTE
-   CompileKeys((char *)0, 0, mark_key_tab);
  #endif
+ 
+ #ifdef COPY_PASTE
Index: patches/shmpatch-screen_h
===================================================================
RCS file: /cvs/ports/misc/screen/patches/shmpatch-screen_h,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 shmpatch-screen_h
--- patches/shmpatch-screen_h   22 Nov 2003 00:56:58 -0000      1.1
+++ patches/shmpatch-screen_h   27 Feb 2019 02:39:40 -0000
@@ -1,7 +1,8 @@
 $OpenBSD: shmpatch-screen_h,v 1.1 2003/11/22 00:56:58 espie Exp $
---- screen.h.orig      2003-08-22 14:28:43.000000000 +0200
-+++ screen.h   2003-11-17 23:37:54.000000000 +0100
-@@ -288,6 +288,10 @@ struct baud_values
+Index: screen.h
+--- screen.h.orig
++++ screen.h
+@@ -308,6 +308,10 @@ struct baud_values
    int sym;    /* symbol defined in ttydev.h */
  };
  
Index: patches/shmpatch-window_c
===================================================================
RCS file: /cvs/ports/misc/screen/patches/shmpatch-window_c,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 shmpatch-window_c
--- patches/shmpatch-window_c   22 Nov 2003 00:56:58 -0000      1.1
+++ patches/shmpatch-window_c   27 Feb 2019 02:39:40 -0000
@@ -1,11 +1,11 @@
 $OpenBSD: shmpatch-window_c,v 1.1 2003/11/22 00:56:58 espie Exp $
---- window.c.orig      2003-09-08 16:27:21.000000000 +0200
-+++ window.c   2003-11-17 23:37:54.000000000 +0100
-@@ -1993,6 +1993,59 @@ char *data;
-     }
+Index: window.c
+--- window.c.orig
++++ window.c
+@@ -2126,6 +2126,59 @@ char *data;
+   WindowDied(p, p->w_exitstatus, 1);
  }
  
-+
 +#ifdef IPC_EXPORT_IMAGE
 +
 +void
@@ -57,6 +57,7 @@ $OpenBSD: shmpatch-window_c,v 1.1 2003/1
 +
 +#endif        /* IPC_EXPORT_IMAGE */
 + 
++
 +
  #ifdef ZMODEM
  
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/misc/screen/pkg/PLIST,v
retrieving revision 1.23
diff -u -p -u -p -r1.23 PLIST
--- pkg/PLIST   11 Aug 2004 10:07:56 -0000      1.23
+++ pkg/PLIST   27 Feb 2019 02:39:40 -0000
@@ -1,5 +1,5 @@
 @comment $OpenBSD: PLIST,v 1.23 2004/08/11 10:07:56 espie Exp $
-bin/screen
+@bin bin/screen
 @info info/screen.info
 @man man/man1/screen.1
 share/examples/screen/

Reply via email to