<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[119587] trunk/dports/sysutils/screen</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/119587">119587</a></dd>
<dt>Author</dt> <dd>cal@macports.org</dd>
<dt>Date</dt> <dd>2014-05-01 13:26:43 -0700 (Thu, 01 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>screen: update to 4.2.1</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportssysutilsscreenPortfile">trunk/dports/sysutils/screen/Portfile</a></li>
<li><a href="#trunkdportssysutilsscreenfilespatchMakefilein">trunk/dports/sysutils/screen/files/patch-Makefile.in</a></li>
<li><a href="#trunkdportssysutilsscreenfilespatchconfighin">trunk/dports/sysutils/screen/files/patch-config.h.in</a></li>
<li><a href="#trunkdportssysutilsscreenfilespatchconfigure">trunk/dports/sysutils/screen/files/patch-configure</a></li>
<li><a href="#trunkdportssysutilsscreenfilespatchmaxargs">trunk/dports/sysutils/screen/files/patch-maxargs</a></li>
<li><a href="#trunkdportssysutilsscreenfilespatchscreenc">trunk/dports/sysutils/screen/files/patch-screen.c</a></li>
<li><a href="#trunkdportssysutilsscreenfilespatchwindowc">trunk/dports/sysutils/screen/files/patch-window.c</a></li>
<li><a href="#trunkdportssysutilsscreenfilespatchwindowsize">trunk/dports/sysutils/screen/files/patch-windowsize</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportssysutilsscreenfilespatchprocesscfixbogusstrncpysizediff">trunk/dports/sysutils/screen/files/patch-process.c-fix-bogus-strncpy-size.diff</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkdportssysutilsscreenfilespatchprocessc">trunk/dports/sysutils/screen/files/patch-process.c</a></li>
<li><a href="#trunkdportssysutilsscreenfilespatchwrp_vertical_split">trunk/dports/sysutils/screen/files/patch-wrp_vertical_split</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportssysutilsscreenPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/sysutils/screen/Portfile (119586 => 119587)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/sysutils/screen/Portfile        2014-05-01 18:29:01 UTC (rev 119586)
+++ trunk/dports/sysutils/screen/Portfile        2014-05-01 20:26:43 UTC (rev 119587)
</span><span class="lines">@@ -4,8 +4,7 @@
</span><span class="cx"> PortSystem          1.0
</span><span class="cx"> 
</span><span class="cx"> name                screen
</span><del>-version             4.0.3
-revision            3
</del><ins>+version             4.2.1
</ins><span class="cx"> homepage            http://www.gnu.org/software/screen/
</span><span class="cx"> description         Screen manager with VT100/ANSI terminal emulation
</span><span class="cx"> long_description    \
</span><span class="lines">@@ -18,11 +17,10 @@
</span><span class="cx">     virtual terminal and a copy-and-paste mechanism that allows moving text \
</span><span class="cx">     regions between windows.
</span><span class="cx"> categories          sysutils
</span><del>-license             GPL-2+
</del><ins>+license             GPL-3+
</ins><span class="cx"> platforms           darwin
</span><span class="cx"> maintainers         nomaintainer
</span><del>-master_sites        http://fresh.t-systems-sfr.com/unix/src/misc/ \
-                    ftp://ftp.uni-erlangen.de/pub/utilities/screen/ \
</del><ins>+master_sites        gnu:${name} \
</ins><span class="cx">                     http://www.cis.nctu.edu.tw/~is85005/dports/screen/:encoding \
</span><span class="cx">                     http://www.cis.nctu.edu.tw/~is85005/dports/screen/r23776/:launchd_priv_header
</span><span class="cx"> 
</span><span class="lines">@@ -31,8 +29,8 @@
</span><span class="cx"> distfiles-append    18:encoding
</span><span class="cx"> 
</span><span class="cx"> checksums           ${distname}${extract.suffix} \
</span><del>-                    rmd160  8c3903c1642ae30fd9d5706298919428552f7754 \
-                    sha256  78f0d5b1496084a5902586304d4a73954b2bfe33ea13edceecf21615c39e6c77 \
</del><ins>+                    rmd160  20ddf4a33f91e60a42a31f02aa2a30a9c5cba9b5 \
+                    sha256  5468545047e301d2b3579f9d9ce00466d14a7eec95ce806e3834a3d6b0b9b080 \
</ins><span class="cx">                     18 \
</span><span class="cx">                     rmd160  bd143058417e1d4c040a2589fdfbf8f9203f0b4c \
</span><span class="cx">                     sha256  4d4b674a61dab6bac9b4207307c5f020fa670fc3948c39e7ea93c7fb9dfb5174 \
</span><span class="lines">@@ -40,7 +38,10 @@
</span><span class="cx">                     rmd160  ea1fb112d58a168c581ee58e761c26f7caed40ec \
</span><span class="cx">                     sha256  dcd2786d82865fb10542c20e97d7052110f7ca9a551f2ab5628c607f20e2bb2f
</span><span class="cx"> 
</span><del>-patchfiles          patch-maxargs patch-windowsize patch-Makefile.in
</del><ins>+patchfiles          patch-maxargs \
+                    patch-windowsize \
+                    patch-Makefile.in \
+                    patch-process.c-fix-bogus-strncpy-size.diff
</ins><span class="cx"> depends_lib         port:ncurses
</span><span class="cx"> 
</span><span class="cx"> extract.only        ${distname}${extract.suffix}
</span><span class="lines">@@ -49,11 +50,9 @@
</span><span class="cx"> }
</span><span class="cx"> configure.args      --mandir=${prefix}/share/man \
</span><span class="cx">                     --infodir=${prefix}/share/info \
</span><del>-                    --enable-locale \
</del><span class="cx">                     --enable-telnet \
</span><span class="cx">                     --enable-colors256 \
</span><span class="cx">                     --enable-rxvt_osc
</span><del>-configure.env       LIBS=-lncurses
</del><span class="cx"> 
</span><span class="cx"> post-destroot {
</span><span class="cx">     xinstall -m 644 ${workpath}/18 ${destroot}${prefix}/share/${name}/utf8encodings
</span><span class="lines">@@ -71,8 +70,10 @@
</span><span class="cx">     # The vproc_priv.h is the private header from launchd, used in Apple's 10.5 screen patches
</span><span class="cx">     # We copied the header file from http://launchd.macosforge.org/trac/browser/trunk/launchd/src/vproc_priv.h, r23776
</span><span class="cx">     distfiles-append    vproc_priv.h:launchd_priv_header
</span><del>-    post-extract        { file copy ${distpath}/vproc_priv.h ${worksrcpath} }
-    patchfiles-append   patch-config.h.in patch-configure patch-pty.c patch-window.c patch-screen.c-leopard
</del><ins>+    post-extract {
+        file copy ${distpath}/vproc_priv.h ${worksrcpath}
+    }
+    patchfiles-append   patch-config.h.in patch-configure patch-window.c patch-screen.c-leopard
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> if {${os.platform} eq &quot;darwin&quot; &amp;&amp; ${os.major} &gt;= 10 &amp;&amp; ${os.major} &lt;= 13} {
</span><span class="lines">@@ -80,16 +81,12 @@
</span><span class="cx">     # The vproc_priv.h is the private header from launchd, used in Apple's 10.6 screen patches
</span><span class="cx">     # We copied the header file from http://launchd.macosforge.org/trac/browser/trunk/launchd/src/vproc_priv.h, r23776
</span><span class="cx">     distfiles-append    vproc_priv.h:launchd_priv_header
</span><del>-    post-extract        { file copy ${distpath}/vproc_priv.h ${worksrcpath} }
-    patchfiles-append   patch-config.h.in patch-configure patch-pty.c patch-window.c patch-screen.c patch-process.c
</del><ins>+    post-extract {
+        file copy ${distpath}/vproc_priv.h ${worksrcpath}
+    }
+    patchfiles-append   patch-config.h.in patch-configure patch-window.c patch-screen.c
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-variant vertical_split description {Apply vertical split patch} {
-    patchfiles-append patch-wrp_vertical_split
-}
-
-default_variants +vertical_split
-
</del><span class="cx"> notes &quot;
</span><span class="cx"> Any screens running before upgrading, will not be available, post-install.
</span><span class="cx"> &quot;
</span></span></pre></div>
<a id="trunkdportssysutilsscreenfilespatchMakefilein"></a>
<div class="modfile"><h4>Modified: trunk/dports/sysutils/screen/files/patch-Makefile.in (119586 => 119587)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/sysutils/screen/files/patch-Makefile.in        2014-05-01 18:29:01 UTC (rev 119586)
+++ trunk/dports/sysutils/screen/files/patch-Makefile.in        2014-05-01 20:26:43 UTC (rev 119587)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><del>---- Makefile.in.orig        2009-01-21 11:55:43.000000000 +0800
-+++ Makefile.in        2009-01-21 11:56:33.000000000 +0800
-@@ -122,7 +122,7 @@
</del><ins>+--- Makefile.in        2014-04-26 12:58:35.000000000 +0200
++++ Makefile.in        2014-05-01 21:36:54.000000000 +0200
+@@ -134,7 +134,7 @@
</ins><span class="cx">          sh $(srcdir)/tty.sh tty.c
</span><span class="cx">  
</span><span class="cx">  comm.h: comm.c comm.sh config.h
</span></span></pre></div>
<a id="trunkdportssysutilsscreenfilespatchconfighin"></a>
<div class="modfile"><h4>Modified: trunk/dports/sysutils/screen/files/patch-config.h.in (119586 => 119587)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/sysutils/screen/files/patch-config.h.in        2014-05-01 18:29:01 UTC (rev 119586)
+++ trunk/dports/sysutils/screen/files/patch-config.h.in        2014-05-01 20:26:43 UTC (rev 119587)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><del>---- config.h.in.orig        2009-01-21 11:58:54.000000000 +0800
-+++ config.h.in        2009-01-21 12:01:53.000000000 +0800
-@@ -208,14 +208,14 @@
</del><ins>+--- config.h.in        2014-04-26 12:58:46.000000000 +0200
++++ config.h.in        2014-05-01 21:36:54.000000000 +0200
+@@ -192,14 +192,14 @@
</ins><span class="cx">   * If screen is installed with permissions to update /etc/utmp (such
</span><span class="cx">   * as if it is installed set-uid root), define UTMPOK.
</span><span class="cx">   */
</span><span class="lines">@@ -17,7 +17,7 @@
</span><span class="cx">  
</span><span class="cx">  /* Set LOGOUTOK to one (1)
</span><span class="cx">   * if you want the user to be able to log her/his windows out.
</span><del>-@@ -231,7 +231,7 @@
</del><ins>+@@ -215,7 +215,7 @@
</ins><span class="cx">   * Set CAREFULUTMP to one (1) if you want that users have at least one
</span><span class="cx">   * window per screen session logged in.
</span><span class="cx">   */
</span></span></pre></div>
<a id="trunkdportssysutilsscreenfilespatchconfigure"></a>
<div class="modfile"><h4>Modified: trunk/dports/sysutils/screen/files/patch-configure (119586 => 119587)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/sysutils/screen/files/patch-configure        2014-05-01 18:29:01 UTC (rev 119586)
+++ trunk/dports/sysutils/screen/files/patch-configure        2014-05-01 20:26:43 UTC (rev 119587)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><del>---- configure.orig        2009-01-21 12:02:42.000000000 +0800
-+++ configure        2009-01-21 12:04:58.000000000 +0800
-@@ -5572,7 +5572,7 @@
</del><ins>+--- configure        2014-04-26 12:58:46.000000000 +0200
++++ configure        2014-05-01 21:36:54.000000000 +0200
+@@ -5413,7 +5413,7 @@
</ins><span class="cx">  
</span><span class="cx">  #include &lt;time.h&gt; /* to get time_t on SCO */
</span><span class="cx">  #include &lt;sys/types.h&gt;
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx">  #include &lt;utmpx.h&gt;
</span><span class="cx">  #define utmp utmpx
</span><span class="cx">  #else
</span><del>-@@ -5581,6 +5581,10 @@
</del><ins>+@@ -5422,6 +5422,10 @@
</ins><span class="cx">  #ifdef __hpux
</span><span class="cx">  #define pututline _pututline
</span><span class="cx">  #endif
</span></span></pre></div>
<a id="trunkdportssysutilsscreenfilespatchmaxargs"></a>
<div class="modfile"><h4>Modified: trunk/dports/sysutils/screen/files/patch-maxargs (119586 => 119587)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/sysutils/screen/files/patch-maxargs        2014-05-01 18:29:01 UTC (rev 119586)
+++ trunk/dports/sysutils/screen/files/patch-maxargs        2014-05-01 20:26:43 UTC (rev 119587)
</span><span class="lines">@@ -1,11 +1,11 @@
</span><del>---- ansi.c.orig        Mon Sep  8 16:24:44 2003
-+++ ansi.c
-@@ -559,7 +559,7 @@ register int len;
-             {
-             case '0': case '1': case '2': case '3': case '4':
-             case '5': case '6': case '7': case '8': case '9':
--              if (curr-&gt;w_NumArgs &lt; MAXARGS)
-+              if (curr-&gt;w_NumArgs &gt;= 0 &amp;&amp; curr-&gt;w_NumArgs &lt; MAXARGS)
</del><ins>+--- ansi.c.orig        2014-05-01 12:51:14.000000000 +0200
++++ ansi.c        2014-05-01 21:33:29.000000000 +0200
+@@ -568,7 +568,7 @@
</ins><span class="cx">                  {
</span><del>-                   if (curr-&gt;w_args[curr-&gt;w_NumArgs] &lt; 100000000)
-                     curr-&gt;w_args[curr-&gt;w_NumArgs] =
</del><ins>+                 case '0': case '1': case '2': case '3': case '4':
+                 case '5': case '6': case '7': case '8': case '9':
+-                  if (curr-&gt;w_NumArgs &lt; MAXARGS)
++                  if (curr-&gt;w_NumArgs &gt;= 0 &amp;&amp; curr-&gt;w_NumArgs &lt; MAXARGS)
+                     {
+                       if (curr-&gt;w_args[curr-&gt;w_NumArgs] &lt; 100000000)
+                         curr-&gt;w_args[curr-&gt;w_NumArgs] =
</ins></span></pre></div>
<a id="trunkdportssysutilsscreenfilespatchprocessc"></a>
<div class="delfile"><h4>Deleted: trunk/dports/sysutils/screen/files/patch-process.c (119586 => 119587)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/sysutils/screen/files/patch-process.c        2014-05-01 18:29:01 UTC (rev 119586)
+++ trunk/dports/sysutils/screen/files/patch-process.c        2014-05-01 20:26:43 UTC (rev 119587)
</span><span class="lines">@@ -1,13 +0,0 @@
</span><del>-diff -r -u screen-4.0.3.orig/process.c screen-4.0.3/process.c
---- process.c   2008-07-06 23:40:16.000000000 -0700
-+++ process.c   2008-07-06 23:47:55.000000000 -0700
-@@ -5466,7 +5466,7 @@
-       *buf = 0;
-       return;
-     }
--  act.nr = (int)data;
-+  act.nr = (int)(intptr_t)data;
-   act.args = noargs;
-   act.argl = 0;
-   DoAction(&amp;act, -1);
-
</del></span></pre></div>
<a id="trunkdportssysutilsscreenfilespatchprocesscfixbogusstrncpysizediff"></a>
<div class="addfile"><h4>Added: trunk/dports/sysutils/screen/files/patch-process.c-fix-bogus-strncpy-size.diff (0 => 119587)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/sysutils/screen/files/patch-process.c-fix-bogus-strncpy-size.diff                                (rev 0)
+++ trunk/dports/sysutils/screen/files/patch-process.c-fix-bogus-strncpy-size.diff        2014-05-01 20:26:43 UTC (rev 119587)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+Reported upstream: https://savannah.gnu.org/bugs/?42257
+--- process.c.orig        2014-05-01 22:01:18.000000000 +0200
++++ process.c        2014-05-01 22:01:50.000000000 +0200
+@@ -6282,7 +6282,7 @@
+   else
+     { strcpy(p = i-&gt;pw2, &quot;\377&quot;); l = sizeof(i-&gt;pw2) - 1; }
+   if (buf &amp;&amp; len)
+-    strncpy(p, buf, 1 + (l &lt; len) ? l : len);
++    strncpy(p, buf, 1 + ((l &lt; len) ? l : len));
+   if (!*i-&gt;name)
+     Input(&quot;Screen User: &quot;, sizeof(i-&gt;name) - 1, INP_COOKED, su_fin, (char *)i, 0);
+   else if (!*i-&gt;pw1)
</ins></span></pre></div>
<a id="trunkdportssysutilsscreenfilespatchscreenc"></a>
<div class="modfile"><h4>Modified: trunk/dports/sysutils/screen/files/patch-screen.c (119586 => 119587)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/sysutils/screen/files/patch-screen.c        2014-05-01 18:29:01 UTC (rev 119586)
+++ trunk/dports/sysutils/screen/files/patch-screen.c        2014-05-01 20:26:43 UTC (rev 119587)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><del>---- screen.c    2003-09-08 07:26:41.000000000 -0700
-+++ screen.c    2009-02-13 12:05:05.000000000 -0800
-@@ -101,6 +101,11 @@
</del><ins>+--- screen.c        2014-04-26 18:22:09.000000000 +0200
++++ screen.c        2014-05-01 21:36:54.000000000 +0200
+@@ -109,6 +109,11 @@
</ins><span class="cx">  
</span><del>- #include &quot;logfile.h&quot;   /* islogfile, logfflush */
</del><ins>+ #include &quot;logfile.h&quot;        /* islogfile, logfflush */
</ins><span class="cx">  
</span><span class="cx"> +#ifdef __APPLE__
</span><span class="cx"> +#include &lt;vproc.h&gt;
</span><span class="lines">@@ -12,8 +12,8 @@
</span><span class="cx">  #ifdef DEBUG
</span><span class="cx">  FILE *dfp;
</span><span class="cx">  #endif
</span><del>-@@ -929,6 +934,16 @@
-    Panic(0, &quot;No $SCREENDIR with multi screens, please.&quot;);
</del><ins>+@@ -1046,6 +1051,16 @@
+         Panic(0, &quot;No $SCREENDIR with multi screens, please.&quot;);
</ins><span class="cx">  #endif
</span><span class="cx">      }
</span><span class="cx"> +#ifdef __APPLE__
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx">  #ifdef MULTIUSER
</span><span class="cx">    if (multiattach)
</span><span class="cx">      {
</span><del>-@@ -1211,6 +1226,11 @@
</del><ins>+@@ -1314,6 +1329,11 @@
</ins><span class="cx">    freopen(&quot;/dev/null&quot;, &quot;w&quot;, stderr);
</span><span class="cx">    debug(&quot;-- screen.back debug started\n&quot;);
</span><span class="cx">  
</span><span class="lines">@@ -41,4 +41,3 @@
</span><span class="cx">    /* 
</span><span class="cx">     * This guarantees that the session owner is listed, even when we
</span><span class="cx">     * start detached. From now on we should not refer to 'LoginName'
</span><del>-
</del></span></pre></div>
<a id="trunkdportssysutilsscreenfilespatchwindowc"></a>
<div class="modfile"><h4>Modified: trunk/dports/sysutils/screen/files/patch-window.c (119586 => 119587)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/sysutils/screen/files/patch-window.c        2014-05-01 18:29:01 UTC (rev 119586)
+++ trunk/dports/sysutils/screen/files/patch-window.c        2014-05-01 20:26:43 UTC (rev 119587)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><del>---- window.c.orig        2009-01-21 12:09:29.000000000 +0800
-+++ window.c        2009-01-21 12:14:04.000000000 +0800
-@@ -25,6 +25,7 @@
</del><ins>+--- window.c        2014-04-26 12:58:35.000000000 +0200
++++ window.c        2014-05-01 21:36:54.000000000 +0200
+@@ -33,6 +33,7 @@
</ins><span class="cx">  #include &lt;sys/stat.h&gt;
</span><span class="cx">  #include &lt;signal.h&gt;
</span><span class="cx">  #include &lt;fcntl.h&gt;
</span><span class="lines">@@ -8,8 +8,8 @@
</span><span class="cx">  #ifndef sun
</span><span class="cx">  # include &lt;sys/ioctl.h&gt;
</span><span class="cx">  #endif
</span><del>-@@ -1387,6 +1388,38 @@
-   return pid;
</del><ins>+@@ -1660,6 +1661,38 @@
+   return r;
</ins><span class="cx">  }
</span><span class="cx">  
</span><span class="cx"> +#ifdef RUN_LOGIN
</span><span class="lines">@@ -45,5 +45,5 @@
</span><span class="cx"> +#endif /* RUN_LOGIN */
</span><span class="cx"> +
</span><span class="cx">  void
</span><del>- execvpe(prog, args, env)
- char *prog, **args, **env;
</del><ins>+ FreePseudowin(w)
+ struct win *w;
</ins></span></pre></div>
<a id="trunkdportssysutilsscreenfilespatchwindowsize"></a>
<div class="modfile"><h4>Modified: trunk/dports/sysutils/screen/files/patch-windowsize (119586 => 119587)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/sysutils/screen/files/patch-windowsize        2014-05-01 18:29:01 UTC (rev 119586)
+++ trunk/dports/sysutils/screen/files/patch-windowsize        2014-05-01 20:26:43 UTC (rev 119587)
</span><span class="lines">@@ -1,8 +1,8 @@
</span><del>---- resize.c.orig        Mon Sep  8 16:26:31 2003
-+++ resize.c
-@@ -682,6 +682,17 @@ int wi, he, hi;
-   if (wi == 0)
-     he = hi = 0;
</del><ins>+--- resize.c        2014-04-26 12:58:35.000000000 +0200
++++ resize.c        2014-05-01 21:36:54.000000000 +0200
+@@ -678,6 +678,17 @@
+       he = 1000;
+     }
</ins><span class="cx">  
</span><span class="cx"> +  if (wi &gt; 1000)
</span><span class="cx"> +    {
</span></span></pre></div>
<a id="trunkdportssysutilsscreenfilespatchwrp_vertical_split"></a>
<div class="delfile"><h4>Deleted: trunk/dports/sysutils/screen/files/patch-wrp_vertical_split (119586 => 119587)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/sysutils/screen/files/patch-wrp_vertical_split        2014-05-01 18:29:01 UTC (rev 119586)
+++ trunk/dports/sysutils/screen/files/patch-wrp_vertical_split        2014-05-01 20:26:43 UTC (rev 119587)
</span><span class="lines">@@ -1,1256 +0,0 @@
</span><del>---- comm.c.orig        2003-09-08 14:25:08.000000000 +0000
-+++ comm.c        2006-07-07 02:39:24.000000000 +0000
-@@ -309,6 +309,7 @@ struct comm comms[RC_LAST + 1] =
-   { &quot;vbellwait&quot;,        ARGS_1 },
-   { &quot;verbose&quot;,                ARGS_01 },
-   { &quot;version&quot;,                ARGS_0 },
-+  { &quot;vert_split&quot;,                NEED_DISPLAY|ARGS_0 },
-   { &quot;wall&quot;,                NEED_DISPLAY|ARGS_1},
-   { &quot;width&quot;,                ARGS_0123 },
-   { &quot;windowlist&quot;,        NEED_DISPLAY|ARGS_012 },
---- display.c.orig        2003-12-05 13:45:41.000000000 +0000
-+++ display.c        2006-07-07 02:39:26.000000000 +0000
-@@ -476,65 +476,306 @@ struct canvas *cv;
-   free(cv);
- }

-+struct canvas *
-+get_new_canvas(target)
-+struct canvas *target;
-+{   /** Allocate a new canvas, and assign it characteristics
-+    equal to those of target. */
-+    struct canvas *cv;
-+
-+    if ((cv = (struct canvas *) calloc(1, sizeof *cv)) == 0)
-+        return NULL;
-+
-+    cv -&gt; c_xs               = target -&gt; c_xs;
-+    cv -&gt; c_xe               = target -&gt; c_xe;
-+    cv -&gt; c_ys               = target -&gt; c_ys;
-+    cv -&gt; c_ye               = target -&gt; c_ye;
-+    cv -&gt; c_xoff             = target -&gt; c_xoff;
-+    cv -&gt; c_yoff             = target -&gt; c_yoff;
-+    cv -&gt; c_display          = target -&gt; c_display;
-+    cv -&gt; c_vplist           = 0;
-+    cv -&gt; c_captev.type      = EV_TIMEOUT;
-+    cv -&gt; c_captev.data      = (char *) cv;
-+    cv -&gt; c_captev.handler   = cv_winid_fn;
-+
-+    cv -&gt; c_blank.l_cvlist   = cv;
-+    cv -&gt; c_blank.l_width    = cv-&gt;c_xe - cv-&gt;c_xs + 1;
-+    cv -&gt; c_blank.l_height   = cv-&gt;c_ye - cv-&gt;c_ys + 1;
-+    cv -&gt; c_blank.l_x        = cv-&gt;c_blank.l_y = 0;
-+    cv -&gt; c_blank.l_layfn    = &amp;BlankLf;
-+    cv -&gt; c_blank.l_data     = 0;
-+    cv -&gt; c_blank.l_next     = 0;
-+    cv -&gt; c_blank.l_bottom   = &amp;cv-&gt;c_blank;
-+    cv -&gt; c_blank.l_blocking = 0;
-+    cv -&gt; c_layer            = &amp;cv-&gt;c_blank;
-+    cv -&gt; c_lnext            = 0;
-+
-+    cv -&gt; c_left  = target -&gt; c_left;
-+    cv -&gt; c_right = target -&gt; c_right;
-+    cv -&gt; c_above = target -&gt; c_above;
-+    cv -&gt; c_below = target -&gt; c_below;
-+
-+    return cv;
-+}
-+
- int
--AddCanvas()
--{
--  int hh, h, i, j;
--  struct canvas *cv, **cvpp;
-+share_limits( type, cv0, cv1)
-+int type;       /* HORIZONTAL or VERTICAL */
-+struct canvas *cv0;  /* canvas to compare against. */
-+struct canvas *cv1;  /* canvas to compare against. */
-+{   /** Return non-zero if the two canvasses share limits. 
-+    (ie, their horizontal or veritcal boundaries are the same)
-+    */
-+    switch (type) {
-+    case HORIZONTAL:
-+        return cv0 -&gt; c_xs == cv1 -&gt; c_xs &amp;&amp; cv0-&gt;c_xe == cv1 -&gt; c_xe;
-+    case VERTICAL:
-+        return cv0 -&gt; c_ys == cv1 -&gt; c_ys &amp;&amp; cv0-&gt;c_ye == cv1 -&gt; c_ye;
-+    }
-+    ASSERT(0);
-+    return 0;
-+}

--  for (cv = D_cvlist, j = 0; cv; cv = cv-&gt;c_next)
--    j++;
--  j++;        /* new canvas */
--  h = D_height - (D_has_hstatus == HSTATUS_LASTLINE);
--  if (h / j &lt;= 1)
--    return -1;
-+int
-+compute_region(type, a, focus, list)
-+int type;  /* 0 - horizontal, 1 - vertical */
-+struct screen_region *a;  /* Return value. */
-+struct canvas *focus;  /* Canvas to compute around. */
-+struct canvas *list;   /* List of all canvasses. */
-+{   /** Find the start and end of the screen region.*/
-+    /*
-+    I'm using the term 'region' here differently
-+    than elsewhere.  Elsewhere, 'region' is synonymous
-+    with 'canvas', but I am using it to denote
-+    a collection of related canvasses.

--  for (cv = D_cvlist; cv; cv = cv-&gt;c_next)
--    if (cv == D_forecv)
-+    Suppose the screen currently looks
-+    like this:
-+    ---------------------------
-+    |  0   |   1    |    2    |
-+    ---------------------------
-+    |  3   |   4    |    5    |
-+    ---------------------------
-+    |          6              |
-+    ---------------------------
-+    |   7  |   8    |    9    |
-+    ---------------------------
-+    Where there are 10 entries in D_cvlist.
-+    Canvasses 0,1,2 are in the same region, as
-+    are cavasses 1 and 4.  We need to be careful not to
-+    lump 1 and 4 together w/8.  The
-+    type of the region containing 0,1,2 is
-+    VERTICAL, since each canvas is created
-+    via a vertical split.
-+
-+    Throughout, I'm assuming that canvasses
-+    are created so that any region will
-+    be contiguous in D_cvlist.
-+
-+    Note: this was written before the screen 
-+    orientation members (c_left, c_above, c_below,
-+    c_right) were added to the struct canvas.
-+    Might want to rewrite this to use those.
-+
-+    Written by Bill Pursell, 23/12/2005
-+    */
-+
-+    struct canvas *cv;  /* Entry in list. */
-+    int seen_focus;     /* Flag used when walking the list. */
-+
-+    seen_focus = 0;
-+    a-&gt;count = 0;
-+    a-&gt;type  = type;
-+
-+    if (type == HORIZONTAL) {
-+        a-&gt;xs = focus -&gt; c_xs;
-+        a-&gt;xe = focus -&gt; c_xe;
-+        a-&gt;ys = -1;
-+    }
-+    if (type == VERTICAL) {
-+        a-&gt;ys = focus -&gt; c_ys;
-+        a-&gt;ye = focus -&gt; c_ye;
-+        a-&gt;xs = -1;
-+    }
-+    /* Count the canvasses in the same region as the
-+    canvas with the focus, and find the limits of the region. */
-+    for (cv = list; cv; cv = cv-&gt;c_next) {
-+        if (cv == focus)
-+            seen_focus = 1;
-+        if (share_limits( type, cv, focus)) {
-+            debug2(&quot;cv = %x  %s\n&quot;, cv, (cv == focus)? &quot;FORE&quot;:&quot;&quot;);
-+            debug2(&quot;x range: %d - %d\n&quot;, cv-&gt;c_xs, cv-&gt;c_xe);
-+            debug2(&quot;y range: %d - %d\n&quot;, cv-&gt;c_ys, cv-&gt;c_ye);
-+            switch (type) {
-+            case HORIZONTAL  : 
-+                if (a-&gt;ys == -1) {
-+                    a-&gt;ys = cv -&gt; c_ys; 
-+                    a-&gt;start = cv;
-+                }
-+                a-&gt;ye = cv -&gt; c_ye;
-       break;
--  ASSERT(cv);
--  cvpp = &amp;cv-&gt;c_next;
-+            case VERTICAL:
-+                if (a-&gt;xs == -1) {
-+                    a-&gt;xs = cv -&gt; c_xs; 
-+                    a-&gt;start = cv;
-+                }
-+                a-&gt;xe = cv -&gt; c_xe;
-+                break;
-+            }

--  if ((cv = (struct canvas *)calloc(1, sizeof *cv)) == 0)
--    return -1;
-+            a-&gt;end = cv;
-+            a-&gt;count++;
-+        }
-+        if (!share_limits(type, cv, focus) || cv -&gt; c_next == NULL) {
-+            if (seen_focus) {
-+                debug2(&quot;x range of Region: %d-%d\n&quot;, a-&gt;xs, a-&gt;xe);
-+                debug2(&quot;y range of Region: %d-%d\n&quot;, a-&gt;ys, a-&gt;ye);
-+                break;
-+            }
-+            else {
-+                switch(type) {
-+                case HORIZONTAL: a-&gt;ys = -1; break;
-+                case VERTICAL  : a-&gt;xs = -1; break;
-+                }
-+                a-&gt;count = 0;
-+            }
-+        }
-+    }

--  cv-&gt;c_xs      = 0;
--  cv-&gt;c_xe      = D_width - 1;
--  cv-&gt;c_ys      = 0;
--  cv-&gt;c_ye      = D_height - 1;
--  cv-&gt;c_xoff    = 0;
--  cv-&gt;c_yoff    = 0;
--  cv-&gt;c_display = display;
--  cv-&gt;c_vplist  = 0;
--  cv-&gt;c_captev.type = EV_TIMEOUT;
--  cv-&gt;c_captev.data = (char *)cv;
--  cv-&gt;c_captev.handler = cv_winid_fn;
-+    switch (type) {
-+    case HORIZONTAL: 
-+        a-&gt;expanse  = a-&gt;ye - a-&gt;ys + 1;  
-+        ASSERT(a-&gt;expanse &lt;=  D_height - (D_has_hstatus == HSTATUS_LASTLINE));
-+        break;
-+    case VERTICAL:   
-+        a-&gt;expanse  = a-&gt;xe - a-&gt;xs + 1;  
-+        ASSERT(a-&gt;expanse &lt;=  D_width);
-+        break;
-+    }
-+    ASSERT(seen_focus);
-+}

--  cv-&gt;c_blank.l_cvlist = cv;
--  cv-&gt;c_blank.l_width = cv-&gt;c_xe - cv-&gt;c_xs + 1;
--  cv-&gt;c_blank.l_height = cv-&gt;c_ye - cv-&gt;c_ys + 1;
--  cv-&gt;c_blank.l_x = cv-&gt;c_blank.l_y = 0;
--  cv-&gt;c_blank.l_layfn = &amp;BlankLf;
--  cv-&gt;c_blank.l_data = 0;
--  cv-&gt;c_blank.l_next = 0;
--  cv-&gt;c_blank.l_bottom = &amp;cv-&gt;c_blank;
--  cv-&gt;c_blank.l_blocking = 0;
--  cv-&gt;c_layer = &amp;cv-&gt;c_blank;
--  cv-&gt;c_lnext = 0;
-+void
-+reset_region_types(region, type)
-+struct screen_region *region;
-+int type;
-+{   /** Set c_type of all the canvasses in the region to type. */

--  cv-&gt;c_next    = *cvpp;
--  *cvpp = cv;
-+    struct canvas *cv;

--  i = 0;
--  for (cv = D_cvlist; cv; cv = cv-&gt;c_next)
--    {
--      hh = h / j-- - 1;
--      cv-&gt;c_ys = i;
--      cv-&gt;c_ye = i + hh - 1;
--      cv-&gt;c_yoff = i;
--      i += hh + 1;
--      h -= hh + 1;
-+    for (cv = region-&gt;start; cv != region-&gt;end-&gt;c_next; cv = cv-&gt;c_next) {
-+        #ifdef DEBUG
-+        switch(type) {
-+        case HORIZONTAL: 
-+            ASSERT (cv-&gt;c_xs == region -&gt; xs &amp;&amp; cv-&gt;c_xe == region -&gt; xe);
-+            break;
-+        case VERTICAL:
-+            ASSERT (cv-&gt;c_ys == region -&gt; ys &amp;&amp; cv-&gt;c_ye == region -&gt; ye);
-+            break;
-+        default:
-+            ASSERT(0);
-+    }
-+        #endif
-+        cv -&gt; c_type = type;
-     }
-+}
-+
-+void
-+debug_print_canvas(cv)
-+struct canvas *cv;
-+{   /** Print cv to the debug file. */
-+#ifdef DEBUG
-+    debug2(&quot;%x %s\n&quot;, cv, (cv == D_forecv)?&quot;  HAS FOCUS&quot;:&quot;&quot;);
-+    debug2(&quot;    above: %x    below: %x\n&quot;, cv-&gt;c_above, cv-&gt;c_below);
-+    debug2(&quot;    left: %x     right: %x\n&quot;, cv-&gt;c_left,  cv-&gt;c_right);
-+    debug3(&quot;    x range: %2d-%2d, xoff = %d\n&quot;, 
-+        cv-&gt;c_xs, cv-&gt;c_xe, cv-&gt;c_xoff);
-+    debug3(&quot;    y range: %2d-%2d yoff = %d\n&quot;, 
-+        cv-&gt;c_ys, cv-&gt;c_ye, cv-&gt;c_yoff);
-+    debug2(&quot;    next: %x   type: %d\n&quot;, cv-&gt;c_next, cv-&gt;c_type);
-+#endif
-+}
-+
-+void
-+debug_print_all_canvasses(header)
-+char *header;
-+{   /** Print the dimensions of all the canvasses
-+    in the current display to the debug file.  Precede
-+    with a line containing the header message. */
-+    #ifdef DEBUG
-+    struct canvas *cv;
-+    char message[BUFSIZ];
-+
-+    sprintf(message,  &quot;%10s %5d: &quot;,__FILE__ , __LINE__);
-+    strcat (message, header);
-+    fprintf(dfp, message);
-+    fflush(dfp);
-+    for (cv = D_cvlist; cv; cv = cv-&gt;c_next) {
-+        debug_print_canvas(cv);
-+    }
-+    #endif
-+    return;
-+}
-+
-+set_internal_orientation(region)
-+struct screen_region *region;
-+{   /** Set the orientation for canvasses inside the region. */
-+
-+    struct canvas *cv;
-+
-+    for (cv = region -&gt; start; cv != region -&gt; end; cv = cv-&gt;c_next) {
-+        ASSERT (cv -&gt; c_type == region -&gt; type);
-+        switch (region-&gt;type) {
-+        case VERTICAL:
-+            cv -&gt; c_right           = cv -&gt; c_next;
-+            cv -&gt; c_next -&gt; c_left  = cv;
-+            break;
-+        case HORIZONTAL:
-+            cv -&gt; c_below           = cv -&gt; c_next;
-+            cv -&gt; c_next -&gt; c_above = cv;
-+            break;
-+        }
-+    }
-+}
-+
-+
-+int
-+AddCanvas(type)
-+int type;  /* Horizontal or Vertical. */
-+{   /** Add a new canvas, via a split. */
-+
-+    struct canvas  *cv;        /* Index into D_cvlist. */
-+    struct screen_region  vr;  /* Canvasses in the same row/column as the 
-+                                  canvas with the focus.   */
-+
-+    compute_region(type, &amp;vr, D_forecv, D_cvlist);
-+
-+    /* Return if the region isn't big enough to split. */
-+    if (vr.expanse / vr.count &lt;= 1)
-+        return -1; 
-+
-+    /* Allocate a new canvas. */
-+    if ( (cv = get_new_canvas(D_forecv)) == NULL)
-+        return -1;
-+
-+    /* Set the type. */
-+    cv -&gt; c_type = D_forecv -&gt; c_type = type;
-+
-+    /* Increment the canvas count to account for the one we will add. */
-+    vr.count++;
-+
-+    debug_print_all_canvasses(&quot;AddCanvas start.\n&quot;);
-+
-+    /* Insert the new canvas after the current foreground. */
-+    cv -&gt; c_next = D_forecv-&gt;c_next;
-+    D_forecv -&gt; c_next = cv;
-+    if (vr.end == D_forecv)
-+        vr.end = cv;
-+
-+    set_internal_orientation(&amp;vr);
-+    equalize_canvas_dimensions(&amp;vr);
-+
-+    debug_print_all_canvasses(&quot;AddCanvas end.\n&quot;);

-   RethinkDisplayViewports();
-   ResizeLayersToCanvases();
-@@ -542,67 +783,595 @@ AddCanvas()
- }

- void
--RemCanvas()
-+get_endpoints(cv, start, end, off)
-+struct canvas *cv;
-+int **start;
-+int **end;
-+int **off;
-+{   /** Set *start, *end, and *off appropriate with cv-&gt;c_type. */
-+    switch (cv-&gt;c_type) {
-+    case HORIZONTAL:
-+        if (start) *start = &amp;cv -&gt; c_ys;
-+        if (end)   *end   = &amp;cv -&gt; c_ye;
-+        if (off)   *off   = &amp;cv -&gt; c_yoff;
-+        break;
-+    case VERTICAL:
-+        if (start) *start = &amp;cv -&gt; c_xs;
-+        if (end)   *end   = &amp;cv -&gt; c_xe;
-+        if (off)   *off   = &amp;cv -&gt; c_xoff;
-+        break;
-+    default: ASSERT(0);
-+    }
-+}
-+
-+#define MIN_HEIGHT 1
-+#define MIN_WIDTH 5
-+
-+int
-+adjust_canvas_dimensions(vr, target, amount)
-+struct screen_region *vr;
-+struct canvas *target;
-+int amount;
-+{   /** Modify the size of target by amount. */
-+    
-+    /* Other canvasses in the region will gain or lose
-+    space to accomodate the change.  Return
-+    the number of rows/columns by which the size 
-+    of target is succesfully enlarged. (if amount &lt;= 0,
-+    return 0) */
-+
-+    struct canvas *this;    /* for walking the list. */
-+    struct canvas *prev;    /* for walking the list backwards. */
-+    int adjusted;           /* Amount already re-allocated. */
-+    int *start, *end, *off; /* c-&gt;c_{x,y}s, c-&gt;c_{x,y}e, and c-&gt;c_{x,y}off */
-+    int minimum, space;
-+
-+    debug1(&quot;adjust: amount = %d\n&quot;, amount);
-+    debug_print_all_canvasses(&quot;ADJUST \n&quot;);
-+
-+    ASSERT(vr-&gt;count &gt; 1);
-+
-+    if (amount == 0)
-+        return 0;
-+
-+    switch(vr-&gt;type) {
-+    case HORIZONTAL:  minimum = MIN_HEIGHT; space = 2; break;
-+    case VERTICAL:    minimum = MIN_WIDTH; space = 1; break;
-+    default: ASSERT(0);
-+    }
-+
-+    if (amount &lt; 0) {
-+        debug_print_all_canvasses(&quot;PREADJUST\n&quot;);
-+
-+        get_endpoints(target, &amp;start, &amp;end, &amp;off);
-+        if (target == vr -&gt; start) {
-+            *end += amount;
-+
-+            if (*end &lt; *start + minimum)
-+                *end = *start + minimum;
-+
-+            get_endpoints(target-&gt;c_next, &amp;start, 0, &amp;off);
-+            *start = *off = *end + space;
-+
-+        debug_print_all_canvasses(&quot;POSTADJUST\n\n&quot;);
-+        }
-+        else {
-+            for (prev = vr-&gt;start; prev-&gt;c_next != target; prev = prev-&gt;c_next)
-+                ;
-+            ASSERT(prev &amp;&amp; prev -&gt; c_next == target);
-+
-+            *start -= amount;
-+            if (*start &gt; *end - minimum)
-+                *start = *end - minimum;
-+            get_endpoints(prev, 0, &amp;end, 0);
-+            *end = *start - space;
-+        }
-+        return 0;
-+    }
-+
-+    ASSERT (amount &gt; 0);
-+
-+    /* Reallocate space from canvasses below target. */
-+    this = vr -&gt; end;
-+    adjusted = 0;
-+    while ( adjusted &lt; amount) {
-+        int this_amount;   /* amount this canvas can yield. */
-+        struct canvas *cv; /* For walking lists. */
-+
-+        if (this == target)
-+            break;
-+
-+        get_endpoints(this, &amp;start, &amp;end, 0);
-+        switch (vr-&gt;type) {
-+        case HORIZONTAL: this_amount = *end - *start - MIN_HEIGHT; break;
-+        case VERTICAL:   this_amount = *end - *start - MIN_WIDTH;  break;
-+        default: ASSERT(0);
-+        }
-+
-+        if (this_amount &gt; amount - adjusted)
-+            this_amount = amount - adjusted;
-+
-+        debug(&quot;target:\n&quot;);
-+        debug_print_canvas(target);
-+
-+        debug(&quot;this:\n&quot;);
-+        debug_print_canvas(this);
-+
-+        /* Move all canvasses between target and this by this_amount. */
-+        for (cv = target; cv != this; cv = cv -&gt; c_next) {
-+            debug1(&quot;this_amount = %d\n&quot;, this_amount);
-+            debug_print_canvas(cv);
-+
-+            get_endpoints(cv, &amp;start, &amp;end, 0);
-+            *end += this_amount;
-+            get_endpoints(cv-&gt;c_next, &amp;start, &amp;end, &amp;off);
-+            *start += this_amount;
-+            *off = *start;
-+        }
-+        adjusted += this_amount;
-+        debug1(&quot;adjusted: %d\n&quot;, adjusted);
-+
-+        debug(&quot;target:\n&quot;);
-+        debug_print_canvas(target);
-+
-+        debug(&quot;this:\n&quot;);
-+        debug_print_canvas(this);
-+
-+
-+        /* Get the previous canvas.  TODO: include back pointers
-+        in struct canvas(?). */
-+        for (prev = vr-&gt;start; prev-&gt;c_next != this; prev = prev-&gt;c_next)
-+            ASSERT(prev);
-+        this = prev;
-+    }
-+    debug1(&quot;adjusted = %d\n&quot;, adjusted);
-+    if (adjusted == amount || target == vr-&gt;start)
-+        return adjusted;
-+
-+    /* Re-allocate space from canvasses above target. */
-+    ASSERT(this == target);
-+    for (prev = vr-&gt;start; prev-&gt;c_next != this; prev = prev-&gt;c_next)
-+        ASSERT(prev);
-+    this = prev;
-+
-+    while (adjusted &lt; amount) {
-+        int this_amount;   /* amount this canvas can yield. */
-+        struct canvas *cv; /* For walking lists. */
-+
-+        get_endpoints(this, &amp;start, &amp;end, 0);
-+        switch (vr-&gt;type) {
-+        case HORIZONTAL: this_amount = *end - *start - MIN_HEIGHT; break;
-+        case VERTICAL:   this_amount = *end - *start - MIN_WIDTH;  break;
-+        default: ASSERT(0);
-+        }
-+
-+        if (this_amount &gt; amount - adjusted)
-+            this_amount = amount - adjusted;
-+
-+        /* Move all canvasses between this and target by this_amount. */
-+        for (cv = this; cv != target; cv = cv -&gt; c_next) {
-+            ASSERT(cv);
-+            debug1(&quot;this_amount = %d\n&quot;, this_amount);
-+            debug_print_canvas(cv);
-+            debug(&quot;NEXT:\n&quot;);
-+            debug_print_canvas(cv-&gt;c_next);
-+
-+            debug(&quot;getend:\n&quot;);
-+            get_endpoints(cv, &amp;start, &amp;end, 0);
-+            ASSERT(end &amp;&amp; start );
-+            ASSERT(start);
-+            ASSERT(*end &gt;= this_amount);
-+            *end -= this_amount;
-+            ASSERT(*end &gt; *start);
-+
-+            debug(&quot;getend:\n&quot;);
-+            ASSERT(cv-&gt;c_next);
-+            get_endpoints(cv-&gt;c_next, &amp;start, &amp;end, &amp;off);
-+            ASSERT(start &amp;&amp; off);
-+            ASSERT(*start &gt;= this_amount);
-+            ASSERT(*start == *off);
-+            *start -= this_amount;
-+            *off = *start;
-+
-+            debug(&quot;adjusted\n&quot;);
-+            debug_print_canvas(cv);
-+            debug(&quot;NEXT:\n&quot;);
-+            debug_print_canvas(cv-&gt;c_next);
-+            debug(&quot;\n&quot;);
-+        }
-+        adjusted += this_amount;
-+
-+        if (this == vr-&gt;start)
-+            break;
-+
-+        for (prev = vr-&gt;start; prev-&gt;c_next != this; prev = prev-&gt;c_next)
-+            ASSERT(prev);
-+        this = prev;
-+    }
-+    debug1(&quot;returning: %d\n&quot;, adjusted);
-+    return adjusted;
-+}
-+
-+void
-+equalize_canvas_dimensions(vr)
-+struct screen_region *vr;
-+{   /** Reset the size of each canvas in the region. */
-+
-+    struct canvas *cv;  /* for walking the list. */
-+    int this_size; /* new size of cv */
-+    int this_start;  /* Start coordinate for current canvas. */
-+
-+    debug(&quot;equalize\n&quot;);
-+
-+    debug2(&quot;vr start = %#x, vr end = %#x\n&quot;, vr-&gt;start, vr-&gt;end);
-+
-+    switch(vr-&gt;type) {
-+    case VERTICAL:   this_start = vr-&gt;xs; break;
-+    case HORIZONTAL: this_start = vr-&gt;ys; break;
-+    }
-+
-+    for (cv = vr-&gt;start ; ; cv = cv-&gt;c_next) {
-+        ASSERT(cv);
-+
-+        /* For the horizontal split, leave space for a status line. */
-+        this_size = vr-&gt;expanse / vr-&gt;count - (vr-&gt;type == HORIZONTAL);
-+
-+        /* Give any additional available rows/columns to the foreground. */
-+        if (cv == D_forecv)
-+            this_size += vr-&gt;expanse % vr-&gt;count;
-+
-+        debug_print_canvas(cv);
-+        debug2(&quot;cv type = %d, vr type = %d\n&quot;, cv-&gt;c_type, vr-&gt;type);
-+        ASSERT(cv -&gt; c_type == vr-&gt;type);
-+
-+        switch(vr-&gt;type) {
-+        case VERTICAL:
-+            cv -&gt; c_xs = cv -&gt; c_xoff = this_start;
-+            cv -&gt; c_xe = this_start + this_size - 1;
-+            this_start += this_size;
-+            break;
-+        case HORIZONTAL:
-+            if (cv == vr-&gt;end &amp;&amp; cv-&gt;c_ye == D_height-1-
-+                (D_has_hstatus == HSTATUS_LASTLINE))
-+                this_size += 1;  /* Don't make space for status line 
-+                    in the bottom region (it already has one). */
-+
-+            cv -&gt; c_ys = cv -&gt; c_yoff = this_start;
-+            cv -&gt; c_ye = this_start + this_size - 1;
-+            this_start += this_size + 1;  /* add one for status line. */
-+            break;
-+        }
-+        if (cv == vr-&gt;end)
-+            break;
-+    }
-+}
-+
-+void
-+remove_canvas_from_list(list, cv)
-+struct canvas **list;
-+struct canvas *cv;
-+{   /** Prune cv from the list.  Does not free cv.*/
-+
-+    struct canvas *pred;  /* Predecssor of cv in list. */
-+
-+    if (cv == *list ) {
-+        *list = cv -&gt; c_next;
-+    }
-+    else {
-+        /* Find the predecessor of cv. */
-+        for (pred = *list; pred-&gt;c_next != cv; pred = pred-&gt;c_next)
-+            ASSERT(pred);
-+
-+        pred -&gt; c_next = cv -&gt; c_next;
-+    }
-+}
-+
-+void
-+redirect_pointers(list, old, new)
-+struct canvas *list;
-+struct canvas *old;
-+struct canvas *new;
-+{  /** For each canvas in the list, change any
-+    of its screen orientation pointers from old to new. 
-+    Canvasses are not allowed to be self-referential,
-+    so set such pointers to NULL.
-+    */
-+    struct canvas *cv;
-+    for (cv=list; cv; cv = cv-&gt;c_next) {
-+        if (cv -&gt; c_left == old)
-+            cv -&gt; c_left = (cv==new)?NULL:new;
-+        if (cv -&gt; c_above == old)
-+            cv -&gt; c_above = (cv==new)?NULL:new;
-+        if (cv -&gt; c_right == old)
-+            cv -&gt; c_right = (cv==new)?NULL:new;
-+        if (cv -&gt; c_below == old)
-+            cv -&gt; c_below = (cv==new)?NULL:new;
-+    }
-+}
-+
-+struct canvas *
-+squeeze(list, target, direction, distance)
-+struct canvas *list;    /* List of canvasses to resize. */
-+struct canvas *target;  /* Canvas in the list being removed. */
-+enum directions direction;          
-+int  distance;  /* Amount to squeeze. */
-+{   /** Resize canvasses in the list so that target 
-+    is shrunk by distance and other canvasses are grown in the 
-+    specified direction.  If distance is 0, target
-+    is destroyed, and the value returned is
-+    the earliest canvas in the list that is grown.
-+
-+    If distance &gt; 0, the value returned is an int,
-+    giving the amount actually sqeezed.  (This needs
-+    re-writing!)
-+    (This becomes the new region head for the region
-+    orphaned by target.)
-+
-+    TODO: this currently only implements distance == 0;
-+    */
-+
-+    struct canvas *ret;  /* The return value.*/
-+    struct canvas *cv;   /* For walking the list.*/
-+
-+    ret = NULL;
-+
-+    if (distance == 0) {
-+        for (cv = list; cv; cv = cv-&gt;c_next) {
-+            int *cv_coord, *cv_off, targ_coord; 
-+            struct canvas **cv_orient, *targ_orient;
-+
-+            switch (direction) {
-+            case RIGHT:
-+                cv_orient   = &amp;cv-&gt;c_right;
-+                cv_coord    = &amp;cv-&gt;c_xe;
-+                cv_off      = 0;
-+                targ_coord  = target-&gt;c_xe;
-+                targ_orient = target-&gt;c_right;
-+                break;
-+            case LEFT:
-+                cv_orient   = &amp;cv-&gt;c_left;
-+                cv_coord    = &amp;cv-&gt;c_xs;
-+                cv_off      = &amp;cv-&gt;c_xoff;
-+                targ_coord  = target-&gt;c_xs;
-+                targ_orient = target-&gt;c_left;
-+                break;
-+            case UP:
-+                cv_orient   = &amp;cv-&gt;c_above;
-+                cv_coord    = &amp;cv-&gt;c_ys;
-+                cv_off      = &amp;cv-&gt;c_yoff;
-+                targ_coord  = target-&gt;c_ys;
-+                targ_orient = target-&gt;c_above;
-+                break;
-+            case DOWN:
-+                cv_orient   = &amp;cv-&gt;c_below;
-+                cv_coord    = &amp;cv-&gt;c_ye;
-+                cv_off      = 0;
-+                targ_coord  = target-&gt;c_ye;
-+                targ_orient = target-&gt;c_below;
-+                break;
-+            }
-+            if (*cv_orient == target) {
-+                *cv_coord = targ_coord;
-+                if(cv_off)
-+                    *cv_off = targ_coord;
-+                *cv_orient = targ_orient;
-+                ret = (ret) ? ret : cv;
-+            }
-+        }
-+    }
-+    else {
-+        ASSERT(distance &gt; 0);
-+        switch (direction) {
-+        /* adjust target first. */
-+        case RIGHT:
-+            if (target-&gt;c_xe - target-&gt;c_xs + distance &lt; MIN_WIDTH)
-+                distance = target-&gt;c_xe - target-&gt;c_xs - MIN_WIDTH;
-+            target-&gt;c_xs += distance;
-+            target-&gt;c_xoff = target -&gt; c_xs;
-+            break;
-+        case LEFT:
-+            if (target-&gt;c_xe - target-&gt;c_xs + distance &lt; MIN_WIDTH)
-+                distance = target-&gt;c_xe - target-&gt;c_xs - MIN_WIDTH;
-+            target-&gt;c_xe -= distance;
-+            break;
-+        case UP:
-+            if (target-&gt;c_ye - target-&gt;c_ys + distance &lt; MIN_HEIGHT)
-+                distance = target-&gt;c_ye - target-&gt;c_ys - MIN_HEIGHT;
-+            target-&gt;c_ye -= distance;
-+            break;
-+        case DOWN:
-+            if (target-&gt;c_ye - target-&gt;c_ys + distance &lt; MIN_HEIGHT)
-+                distance = target-&gt;c_ye - target-&gt;c_ys - MIN_HEIGHT;
-+            target-&gt;c_ys += distance;
-+            target-&gt;c_yoff = target -&gt; c_ys;
-+            break;
-+        }
-+        for (cv = list; cv; cv = cv-&gt;c_next) {
-+            int *cv_coord, *cv_off, new_coord; 
-+            struct canvas **cv_orient;
-+
-+            debug(&quot;SQUEEZE\n&quot;);
-+            debug_print_canvas(cv);
-+
-+            if (cv == target)
-+                continue;
-+
-+            switch (direction) {
-+            case RIGHT:
-+                cv_orient   = &amp;cv-&gt;c_right;
-+                cv_coord    = &amp;cv-&gt;c_xe;
-+                cv_off      = 0;
-+                new_coord   = cv-&gt;c_xe + distance;
-+                break;
-+            case LEFT:
-+                cv_orient   = &amp;cv-&gt;c_left;
-+                cv_coord    = &amp;cv-&gt;c_xs;
-+                cv_off      = &amp;cv-&gt;c_xoff;
-+                new_coord   = cv-&gt;c_xs - distance;
-+                break;
-+            case UP:
-+                cv_orient   = &amp;cv-&gt;c_above;
-+                cv_coord    = &amp;cv-&gt;c_ys;
-+                cv_off      = &amp;cv-&gt;c_yoff;
-+                new_coord   = cv-&gt;c_ys - distance;
-+                break;
-+            case DOWN:
-+                cv_orient   = &amp;cv-&gt;c_below;
-+                cv_coord    = &amp;cv-&gt;c_ye;
-+                cv_off      = 0;
-+                new_coord   = cv-&gt;c_ye + distance;
-+                break;
-+            }
-+            if (*cv_orient == target) {
-+                *cv_coord = new_coord;
-+                if(cv_off)
-+                    *cv_off = new_coord;
-+            }
-+        }
-+        ret = (struct canvas *) distance;
-+    }
-+
-+
-+    debug2(&quot;squeeze: target = %#x, ret = %#x\n&quot;, target, ret);
-+    return ret;
-+}
-+
-+
-+struct canvas *
-+grow_surrounding_regions(list, fore, amount)
-+    struct canvas *list;
-+    struct canvas *fore;
-+    int amount;
- {
--  int hh, h, i, j;
--  struct canvas *cv, **cvpp;
--  int did = 0;
-+    /* Grow all the regions in the list that border
-+    fore appropriately.  */
-+    struct canvas *cv;        /* For walking the list. */
-+    struct canvas *new_fore;  /* Replacement for fore. */

--  h = D_height - (D_has_hstatus == HSTATUS_LASTLINE);
--  for (cv = D_cvlist, j = 0; cv; cv = cv-&gt;c_next)
--    j++;
--  if (j == 1)
--    return;
--  i = 0;
--  j--;
--  for (cvpp = &amp;D_cvlist; (cv = *cvpp); cvpp = &amp;cv-&gt;c_next)
--    {
--      if (cv == D_forecv &amp;&amp; !did)
--        {
--          *cvpp = cv-&gt;c_next;
--          FreeCanvas(cv);
--          cv = *cvpp;
--          D_forecv = cv ? cv : D_cvlist;
--          D_fore = Layer2Window(D_forecv-&gt;c_layer);
--          flayer = D_forecv-&gt;c_layer;
--          if (cv == 0)
-+    debug(&quot;grow_surrounding_regions\n&quot;);
-+
-+    new_fore = NULL;
-+    if (amount == 0) {
-+        if (fore != list) {
-+            /* Grow the regions from above (the left). */
-+            switch (fore -&gt; c_type) {
-+            case HORIZONTAL: 
-+                if ( !(new_fore = squeeze(list, fore, DOWN, 0))) 
-+                    new_fore = squeeze(list, fore, RIGHT, 0);
-+                break;
-+            case VERTICAL:   
-+                if ( !(new_fore = squeeze(list, fore, RIGHT, 0)))
-+                    new_fore = squeeze(list, fore, DOWN, 0);
-             break;
--          did = 1;
-         }
--      hh = h / j-- - 1;
--      if (!captionalways &amp;&amp; i == 0 &amp;&amp; j == 0)
--        hh++;
--      cv-&gt;c_ys = i;
--      cv-&gt;c_ye = i + hh - 1;
--      cv-&gt;c_yoff = i;
--      i += hh + 1;
--      h -= hh + 1;
-     }
-+        else {  /* Grow the regions from below (the right). */
-+            switch (fore -&gt; c_type) {
-+            case HORIZONTAL: 
-+                if ( !(new_fore = squeeze(list, fore, UP, 0)))
-+                    new_fore = squeeze(list, fore, LEFT, 0); 
-+                break;
-+            case VERTICAL:   
-+                if ( !(new_fore = squeeze(list, fore, LEFT, 0)))
-+                    new_fore = squeeze(list, fore, UP, 0);
-+            break;
-+        }
-+    }
-+        ASSERT (new_fore);
-+        return new_fore;
-+    }
-+}
-+
-+
-+void
-+RemCanvas()
-+{   /** Remove the foreground canvas. */
-+
-+    struct screen_region  vr; /*Canvasses in the same row/column as D_forecv.*/
-+    struct canvas *new_fore;  /* Canvas which will replace D_forecv. */
-+
-+    /* Do nothing if the foreground is the only canvas. */
-+    if (D_cvlist-&gt;c_next == NULL)
-+        return;
-+
-+    compute_region(D_forecv-&gt;c_type, &amp;vr, D_forecv, D_cvlist);
-+
-+    debug1(&quot;RemCanvas. count = %d\n&quot;,vr.count);
-+    debug_print_all_canvasses(&quot;RemCanvas() start\n&quot;);
-+
-+    if (vr.count &gt; 1) {  /* Resize the neighboring canvas in region. */
-+        debug2(&quot;D_forecv = %x  vr.start = %x\n&quot;,D_forecv, vr.start);
-+        /* If there is a canvas before D_forecv, then
-+        grow that canvas to take up the space. */
-+        if (D_forecv != vr.start) {
-+            struct canvas *pred;  /* Predecssor of D_forecv. */
-+            for (pred = vr.start; pred-&gt;c_next != D_forecv; )
-+                pred = pred-&gt;c_next;
-+
-+            new_fore         = pred;
-+            new_fore -&gt; c_ye = D_forecv-&gt;c_ye;
-+            new_fore -&gt; c_xe = D_forecv-&gt;c_xe;
-+
-+        } 
-+        else {
-+            new_fore           = D_forecv -&gt; c_next;
-+            new_fore -&gt; c_ys   = D_forecv -&gt; c_ys;
-+            new_fore -&gt; c_xs   = D_forecv -&gt; c_xs;
-+            new_fore -&gt; c_yoff = new_fore -&gt; c_ys;
-+            new_fore -&gt; c_xoff = new_fore -&gt; c_xs;
-+        }
-+    }
-+    else { /* Resize all bordering regions. */
-+        new_fore = grow_surrounding_regions( D_cvlist, D_forecv,0);
-+    }
-+    debug_print_canvas(new_fore);
-+
-+    /* Redirect all pointers in the list. */
-+    redirect_pointers(D_cvlist, D_forecv, new_fore);
-+
-+    remove_canvas_from_list(&amp;D_cvlist, D_forecv);
-+    FreeCanvas(D_forecv);
-+    D_forecv = new_fore;
-+    D_fore   = Layer2Window(D_forecv-&gt;c_layer);
-+    flayer   = D_forecv-&gt;c_layer;
-+
-+    debug2(&quot;RemCanvas. forecv = %#x  new_fore = %#x\n&quot;, D_forecv, new_fore);
-+    debug_print_all_canvasses(&quot;RemCanvas() end.\n&quot;);
-+
-   RethinkDisplayViewports();
-   ResizeLayersToCanvases();
- }

- void
--OneCanvas()
--{
--  struct canvas *mycv = D_forecv;
--  struct canvas *cv, **cvpp;
-+OneCanvas(list, target)
-+struct canvas **list;
-+struct canvas  *target;
-+{   /* Free all canvasses in the list except for
-+    target.  Make *list reference target. */
-+    struct canvas  *cv;
-+    struct canvas *next;

--  for (cvpp = &amp;D_cvlist; (cv = *cvpp);)
--    {
--      if (cv == mycv)
--        {
--          cv-&gt;c_ys = 0;
--          cv-&gt;c_ye = D_height - 1 - (D_has_hstatus == HSTATUS_LASTLINE) - captionalways;
--          cv-&gt;c_yoff = 0;
--          cvpp = &amp;cv-&gt;c_next;
--        }
--      else
--        {
--          *cvpp = cv-&gt;c_next;
-+    debug_print_all_canvasses(&quot;OneCanvas start.\n&quot;);
-+    for (cv = *list; cv; cv = next) {
-+        next = cv -&gt; c_next;
-+        if (cv == target) {
-+            cv -&gt; c_xoff  = 0;
-+            cv -&gt; c_xs    = 0;
-+            cv -&gt; c_xe    = D_width-1;
-+            cv -&gt; c_yoff  = 0;
-+            cv -&gt; c_ys    = 0;
-+            cv -&gt; c_ye    = D_height - 1 - (D_has_hstatus ==
-+                HSTATUS_LASTLINE) - captionalways;
-+            cv -&gt; c_left  = cv-&gt;c_right = NULL;
-+            cv -&gt; c_above = cv-&gt;c_below = NULL;
-+            cv -&gt; c_next    = NULL;
-+        } else {
-           FreeCanvas(cv);
-         }
-     }
-+    *list = target;
-+    debug_print_all_canvasses(&quot;OneCanvas end.\n&quot;);
-+
-   RethinkDisplayViewports();
-   ResizeLayersToCanvases();
- }
---- display.h.orig        2003-07-01 14:01:42.000000000 +0000
-+++ display.h        2006-07-07 02:39:25.000000000 +0000
-@@ -58,6 +58,11 @@ struct canvas
-   int              c_ys;
-   int              c_ye;
-   struct event     c_captev;        /* caption changed event */
-+  int              c_type;     /* which type of split created the canvas. */
-+  struct canvas   *c_right;    /* canvas to the right. */
-+  struct canvas   *c_left;     /* canvas to the left.  */
-+  struct canvas   *c_above;    /* canvas above. */
-+  struct canvas   *c_below;    /* canvas below. */
- };

- struct viewport
---- extern.h.orig        2003-08-22 12:27:57.000000000 +0000
-+++ extern.h        2006-07-07 02:39:25.000000000 +0000
-@@ -289,9 +289,9 @@ extern void  NukePending __P((void));
- #endif
- extern void  SetCanvasWindow __P((struct canvas *, struct win *));
- extern int   MakeDefaultCanvas __P((void));
--extern int   AddCanvas __P((void));
-+extern int   AddCanvas __P((int));
- extern void  RemCanvas __P((void));
--extern void  OneCanvas __P((void));
-+extern void  OneCanvas __P((struct canvas **, struct canvas *));
- extern int   RethinkDisplayViewports __P((void));
- extern void  RethinkViewportOffsets __P((struct canvas *));
- #ifdef RXVT_OSC
-@@ -490,3 +490,16 @@ extern int   PrepareEncodedChar __P((int
- # endif
- #endif
- extern int   EncodeChar __P((char *, int, int, int *));
-+extern int   compute_region __P((int,struct screen_region *, struct canvas *, struct canvas *));
-+extern void  reset_region_types __P((struct screen_region *, int));
-+extern void  equalize_canvas_dimensions __P((struct screen_region *));
-+extern int   adjust_canvas_dimensions __P((struct screen_region *, struct canvas *, int));
-+enum directions {
-+    LEFT,
-+    RIGHT,
-+    UP,
-+    DOWN
-+};
-+
-+extern struct canvas * squeeze __P(( struct canvas *, struct canvas *,
-+    enum directions, int  distance));
---- process.c.orig        2003-09-18 12:53:54.000000000 +0000
-+++ process.c        2006-07-07 02:39:26.000000000 +0000
-@@ -548,6 +548,7 @@ InitKeytab()
-   ktab['B'].nr = RC_POW_BREAK;
-   ktab['_'].nr = RC_SILENCE;
-   ktab['S'].nr = RC_SPLIT;
-+  ktab['V'].nr = RC_VERT_SPLIT;
-   ktab['Q'].nr = RC_ONLY;
-   ktab['X'].nr = RC_REMOVE;
-   ktab['F'].nr = RC_FIT;
-@@ -3649,7 +3650,11 @@ int key;
-       break;
- #endif /* MULTIUSER */
-     case RC_SPLIT:
--      AddCanvas();
-+        AddCanvas(HORIZONTAL);
-+        Activate(-1);
-+        break;
-+    case RC_VERT_SPLIT:
-+        AddCanvas(VERTICAL);
-       Activate(-1);
-       break;
-     case RC_REMOVE:
-@@ -3657,7 +3662,7 @@ int key;
-       Activate(-1);
-       break;
-     case RC_ONLY:
--      OneCanvas();
-+      OneCanvas(&amp;D_cvlist, D_forecv);
-       Activate(-1);
-       break;
-     case RC_FIT:
-@@ -5877,104 +5882,51 @@ static void
- ResizeRegions(arg)
- char *arg;
- {
--  struct canvas *cv;
--  int nreg, dsize, diff, siz;
-+    struct screen_region  region;  /* Region in which D_forecv resides. */
-+    int    adjusted;
-+
-+    /* Note: there's a nomenclature problem here.  I'm using 'region' 
-+    to mean a set of canvasses that are related geographically
-+    in the display.  The documentation uses 'region' to refer to
-+    a single canvas (that's the usage in the error message
-+    below). */

-   ASSERT(display);
--  for (nreg = 0, cv = D_cvlist; cv; cv = cv-&gt;c_next)
--    nreg++;
--  if (nreg &lt; 2)
--    {
--      Msg(0, &quot;resize: need more than one region&quot;);
--      return;
--    }
--  dsize = D_height - (D_has_hstatus == HSTATUS_LASTLINE);
--  if (*arg == '=')
--    {
--      /* make all regions the same height */
--      int h = dsize;
--      int hh, i = 0;
--      for (cv = D_cvlist; cv; cv = cv-&gt;c_next)
--        {
--          hh = h / nreg-- - 1;
--          cv-&gt;c_ys = i;
--          cv-&gt;c_ye = i + hh - 1;
--          cv-&gt;c_yoff = i;
--          i += hh + 1;
--          h -= hh + 1;
--        }
--      RethinkDisplayViewports();
--      ResizeLayersToCanvases();
-+    if (D_cvlist -&gt; c_next == NULL) {
-+        Msg(0, &quot;More than one region required.&quot;);
-       return;
-     }
--  siz = D_forecv-&gt;c_ye - D_forecv-&gt;c_ys + 1;
--  if (*arg == '+')
--    diff = atoi(arg + 1);
--  else if (*arg == '-')
--    diff = -atoi(arg + 1);
--  else if (!strcmp(arg, &quot;min&quot;))
--    diff = 1 - siz;
--  else if (!strcmp(arg, &quot;max&quot;))
--    diff = dsize - (nreg - 1) * 2 - 1 - siz;
--  else
--    diff = atoi(arg) - siz;
--  if (diff == 0)
--    return;
--  if (siz + diff &lt; 1)
--    diff = 1 - siz;
--  if (siz + diff &gt; dsize - (nreg - 1) * 2 - 1)
--    diff = dsize - (nreg - 1) * 2 - 1 - siz;
--  if (diff == 0 || siz + diff &lt; 1)
--    return;

--  if (diff &lt; 0)
--    {
--      if (D_forecv-&gt;c_next)
--        {
--          D_forecv-&gt;c_ye += diff;
--          D_forecv-&gt;c_next-&gt;c_ys += diff;
--          D_forecv-&gt;c_next-&gt;c_yoff += diff;
--        }
--      else
--        {
--          for (cv = D_cvlist; cv; cv = cv-&gt;c_next)
--            if (cv-&gt;c_next == D_forecv)
-+    compute_region(D_forecv-&gt;c_type, &amp;region, D_forecv, D_cvlist);
-+    reset_region_types(&amp;region, D_forecv-&gt;c_type);
-+
-+    if (region.count &gt; 1) {
-+        switch (*arg) {
-+        case '=': equalize_canvas_dimensions(&amp;region); break;
-+        case '-': adjust_canvas_dimensions(&amp;region, D_forecv, -atoi(arg+1)); break;
-+        case '+': 
-+            adjusted = adjust_canvas_dimensions(&amp;region, D_forecv, atoi(arg+1)); 
-               break;
--          ASSERT(cv);
--          cv-&gt;c_ye -= diff;
--          D_forecv-&gt;c_ys -= diff;
--          D_forecv-&gt;c_yoff -= diff;
--        }
--    }
--  else
--    {
--      int s, i = 0, found = 0, di = diff, d2;
--      s = dsize - (nreg - 1) * 2 - 1 - siz;
--      for (cv = D_cvlist; cv; i = cv-&gt;c_ye + 2, cv = cv-&gt;c_next)
--        {
--          if (cv == D_forecv)
--            {
--              cv-&gt;c_ye = i + (cv-&gt;c_ye - cv-&gt;c_ys) + diff;
--              cv-&gt;c_yoff -= cv-&gt;c_ys - i;
--              cv-&gt;c_ys = i;
--              found = 1;
--              continue;
-+        case 'm':
-+            if (!strcmp(arg, &quot;min&quot;))
-+                adjust_canvas_dimensions(&amp;region, D_forecv, -region.expanse);
-+            else if (!strcmp(arg, &quot;max&quot;))
-+                adjust_canvas_dimensions(&amp;region, D_forecv, region.expanse);
-+              break;
-+        default:
-+            Msg(0, &quot;resize: arguments munged&quot;);
-             }
--          s -= cv-&gt;c_ye - cv-&gt;c_ys;
--          if (!found)
--            {
--              if (s &gt;= di)
--                continue;
--              d2 = di - s;
-             }
--          else
--            d2 = di &gt; cv-&gt;c_ye - cv-&gt;c_ys ? cv-&gt;c_ye - cv-&gt;c_ys : di;
--          di -= d2;
--          cv-&gt;c_ye = i + (cv-&gt;c_ye - cv-&gt;c_ys) - d2;
--          cv-&gt;c_yoff -= cv-&gt;c_ys - i;
--          cv-&gt;c_ys = i;
-+    else {
-+        /*TODO Need to expand this canvas into surrounding regions...*/
-+        switch(*arg) {
-+        case '=': Msg(0, &quot;More than one region required.&quot;); return;
-+        // http://lists.gnu.org/archive/html/screen-users/2006-06/msg00012.html
-+        // case '-': squeeze(D_cvlist, D_forecv, RIGHT, atoi(arg+1)); break;
-+        default : Msg(0, &quot;More than one region required.&quot;); return;
-         }
-     }
-+
-   RethinkDisplayViewports();
-   ResizeLayersToCanvases();
- }
---- screen.h.orig        2003-08-22 12:28:43.000000000 +0000
-+++ screen.h        2006-07-07 02:39:26.000000000 +0000
-@@ -288,8 +288,25 @@ struct baud_values
-   int sym;        /* symbol defined in ttydev.h */
- };

-+struct screen_region {
-+    /* This is a group of canvasses that are all in 
-+    the same column or row. */
-+    struct canvas *start;   /* First canvas in the region. */
-+    struct canvas *end;     /* Last canvas in the region. */
-+    int            expanse; /* Range in the appropriate direction. */
-+    int            count;   /* Number of canvasses in the region. */
-+    int            type;    /* HORIZONTAL or VERTICAL. */
-+    int            xs;      /* starting x coordinate */
-+    int            xe;      /* ending   x coordinate */
-+    int            ys;      /* starting y coordinate */
-+    int            ye;      /* ending   y coordinate */
-+};
-+
- /*
-  * windowlist orders
-  */
- #define WLIST_NUM 0
- #define WLIST_MRU 1
-+
-+#define HORIZONTAL 0
-+#define VERTICAL 1
</del></span></pre>
</div>
</div>

</body>
</html>