1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0656
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 8.1.0656
Problem: Trying to reconnect to X server may cause problems.
Solution: Do no try reconnecting when exiting. (James McCoy)
Files: src/os_unix.c
*** ../vim-8.1.0655/src/os_unix.c 2018-12-28 17:01:55.307292166 +0100
--- src/os_unix.c 2018-12-29 10:55:01.706850859 +0100
***************
*** 1671,1676 ****
--- 1671,1702 ----
return 0;
}
+ /*
+ * Return TRUE when connection to the X server is desired.
+ */
+ static int
+ x_connect_to_server(void)
+ {
+ // No point in connecting if we are exiting or dying.
+ if (exiting || v_dying)
+ return FALSE;
+
+ #if defined(FEAT_CLIENTSERVER)
+ if (x_force_connect)
+ return TRUE;
+ #endif
+ if (x_no_connect)
+ return FALSE;
+
+ /* Check for a match with "exclude:" from 'clipboard'. */
+ if (clip_exclude_prog != NULL)
+ {
+ if (vim_regexec_prog(&clip_exclude_prog, FALSE, T_NAME, (colnr_T)0))
+ return FALSE;
+ }
+ return TRUE;
+ }
+
#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD)
# if defined(HAVE_SETJMP_H)
/*
***************
*** 1716,1722 ****
static void
may_restore_clipboard(void)
{
! if (xterm_dpy_retry_count > 0)
{
--xterm_dpy_retry_count;
--- 1742,1749 ----
static void
may_restore_clipboard(void)
{
! // Only try restoring if we want the connection.
! if (x_connect_to_server() && xterm_dpy_retry_count > 0)
{
--xterm_dpy_retry_count;
***************
*** 1737,1764 ****
#endif
/*
- * Return TRUE when connection to the X server is desired.
- */
- static int
- x_connect_to_server(void)
- {
- #if defined(FEAT_CLIENTSERVER)
- if (x_force_connect)
- return TRUE;
- #endif
- if (x_no_connect)
- return FALSE;
-
- /* Check for a match with "exclude:" from 'clipboard'. */
- if (clip_exclude_prog != NULL)
- {
- if (vim_regexec_prog(&clip_exclude_prog, FALSE, T_NAME, (colnr_T)0))
- return FALSE;
- }
- return TRUE;
- }
-
- /*
* Test if "dpy" and x11_window are valid by getting the window title.
* I don't actually want it yet, so there may be a simpler call to use, but
* this will cause the error handler x_error_check() to be called if anything
--- 1764,1769 ----
*** ../vim-8.1.0655/src/version.c 2018-12-28 23:22:36.270750732 +0100
--- src/version.c 2018-12-29 10:59:48.804432411 +0100
***************
*** 801,802 ****
--- 801,804 ----
{ /* Add new patch number below this line */
+ /**/
+ 656,
/**/
--
"Thou shalt not follow the Null Pointer, for at its end Chaos and
Madness lie."
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|