forked from pool/screen
- Fix sort command to not stop at window gaps.
That can happen if windows got deleted and the window numbers do not increment sequentially anymore. OBS-URL: https://build.opensuse.org/package/show/Base:System/screen?expand=0&rev=39
This commit is contained in:
parent
603a97f8a3
commit
becfc8a51c
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Oct 25 13:11:20 UTC 2012 - trenn@suse.de
|
||||||
|
|
||||||
|
- Fix sort command to not stop at window gaps.
|
||||||
|
That can happen if windows got deleted and the window numbers do not
|
||||||
|
increment sequentially anymore.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Oct 9 07:47:52 UTC 2012 - lnt-sysadmin@lists.lrz.de
|
Tue Oct 9 07:47:52 UTC 2012 - lnt-sysadmin@lists.lrz.de
|
||||||
|
|
||||||
|
@ -1,5 +1,13 @@
|
|||||||
--- ./comm.c.orig 2012-06-08 15:20:17.000000000 +0000
|
---
|
||||||
+++ ./comm.c 2012-06-08 16:03:10.000000000 +0000
|
comm.c | 1 +
|
||||||
|
doc/screen.1 | 5 +++++
|
||||||
|
process.c | 43 +++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
3 files changed, 49 insertions(+)
|
||||||
|
|
||||||
|
Index: comm.c
|
||||||
|
===================================================================
|
||||||
|
--- comm.c.orig
|
||||||
|
+++ comm.c
|
||||||
@@ -297,6 +297,7 @@ struct comm comms[RC_LAST + 1] =
|
@@ -297,6 +297,7 @@ struct comm comms[RC_LAST + 1] =
|
||||||
{ "sleep", ARGS_1 },
|
{ "sleep", ARGS_1 },
|
||||||
{ "slowpaste", NEED_FORE|ARGS_01 },
|
{ "slowpaste", NEED_FORE|ARGS_01 },
|
||||||
@ -8,8 +16,10 @@
|
|||||||
{ "source", ARGS_1 },
|
{ "source", ARGS_1 },
|
||||||
{ "split", NEED_DISPLAY|ARGS_01 },
|
{ "split", NEED_DISPLAY|ARGS_01 },
|
||||||
{ "startup_message", ARGS_1 },
|
{ "startup_message", ARGS_1 },
|
||||||
--- ./doc/screen.1.orig 2012-06-08 16:02:58.000000000 +0000
|
Index: doc/screen.1
|
||||||
+++ ./doc/screen.1 2012-06-08 16:03:10.000000000 +0000
|
===================================================================
|
||||||
|
--- doc/screen.1.orig
|
||||||
|
+++ doc/screen.1
|
||||||
@@ -3015,6 +3015,11 @@ underlying system exposes flow control p
|
@@ -3015,6 +3015,11 @@ underlying system exposes flow control p
|
||||||
text.
|
text.
|
||||||
.sp
|
.sp
|
||||||
@ -22,9 +32,11 @@
|
|||||||
.BI "source " file
|
.BI "source " file
|
||||||
.PP
|
.PP
|
||||||
Read and execute commands from file \fIfile\fP. Source commands may
|
Read and execute commands from file \fIfile\fP. Source commands may
|
||||||
--- ./process.c.orig 2012-06-08 15:20:18.000000000 +0000
|
Index: process.c
|
||||||
+++ ./process.c 2012-06-08 16:03:10.000000000 +0000
|
===================================================================
|
||||||
@@ -3024,6 +3024,47 @@ int key;
|
--- process.c.orig
|
||||||
|
+++ process.c
|
||||||
|
@@ -3024,6 +3024,49 @@ int key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -38,32 +50,34 @@
|
|||||||
+ "and try again\n");
|
+ "and try again\n");
|
||||||
+ break;
|
+ break;
|
||||||
+ }
|
+ }
|
||||||
+ i = 0;
|
+ /*
|
||||||
+ if (!wtab[i] || !wtab[i+1])
|
+ * Simple sort algorithm: Look out for the smallest, put it
|
||||||
|
+ * to the first place, look out for the 2nd smallest, ...
|
||||||
|
+ */
|
||||||
|
+ for (i = 0; i < maxwin ; i++)
|
||||||
+ {
|
+ {
|
||||||
+ Msg(0, "Less than two windows, sorting makes no sense.\n");
|
+ if (wtab[i] == NULL)
|
||||||
+ break;
|
+ continue;
|
||||||
+ }
|
+ n = i;
|
||||||
+ for (i = 0; wtab[i+1] != NULL; i++)
|
+ for (nr = i + 1; nr < maxwin; nr++)
|
||||||
+ {
|
|
||||||
+ for (n = i, nr = i; wtab[n+1] != NULL; n++)
|
|
||||||
+ {
|
+ {
|
||||||
+ if (strcmp(wtab[nr]->w_title,wtab[n+1]->w_title) > 0)
|
+ if (wtab[nr] == NULL)
|
||||||
+ {
|
+ continue;
|
||||||
+ nr = n+1;
|
+ debug2("Testing window %d and %d.\n", nr, n);
|
||||||
+ }
|
+ if (strcmp(wtab[nr]->w_title,wtab[n]->w_title) < 0)
|
||||||
|
+ n = nr;
|
||||||
+ }
|
+ }
|
||||||
+ if (nr != i)
|
+ if (n != i)
|
||||||
+ {
|
+ {
|
||||||
+ debug2("Exchange window %d and %d.\n", i, nr);
|
+ debug2("Exchange window %d and %d.\n", i, n);
|
||||||
+ p = wtab[nr];
|
+ p = wtab[n];
|
||||||
+ wtab[nr] = wtab[i];
|
+ wtab[n] = wtab[i];
|
||||||
+ wtab[i] = p;
|
+ wtab[i] = p;
|
||||||
+ wtab[nr]->w_number = nr;
|
+ wtab[n]->w_number = n;
|
||||||
+ wtab[i]->w_number = i;
|
+ wtab[i]->w_number = i;
|
||||||
+#ifdef MULTIUSER
|
+#ifdef MULTIUSER
|
||||||
+ /* exchange the acls for these windows. */
|
+ /* exchange the acls for these windows. */
|
||||||
+ AclWinSwap(i, nr);
|
+ AclWinSwap(i, n);
|
||||||
+#endif
|
+#endif
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
Loading…
Reference in New Issue
Block a user