]>
Commit | Line | Data |
---|---|---|
47612863 AF |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 6.2.018 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=ISO-8859-1 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 6.2.018 | |
11 | Problem: When using the XSMP protocol and reading from stdin Vim may wait | |
12 | for a key to be pressed. | |
13 | Solution: Avoid that RealWaitForChar() is used recursively. | |
14 | Files: src/os_unix.c | |
15 | ||
16 | ||
17 | *** ../vim-6.2.017/src/os_unix.c Thu Jun 5 12:24:08 2003 | |
18 | --- src/os_unix.c Wed Jul 2 20:59:55 2003 | |
19 | *************** | |
20 | *** 3994,3999 **** | |
21 | --- 4000,4007 ---- | |
22 | { | |
23 | int ret; | |
24 | #if defined(FEAT_XCLIPBOARD) || defined(USE_XSMP) | |
25 | + static int busy = FALSE; | |
26 | + | |
27 | /* May retry getting characters after an event was handled. */ | |
28 | # define MAY_LOOP | |
29 | ||
30 | *************** | |
31 | *** 4016,4021 **** | |
32 | --- 4024,4034 ---- | |
33 | )) | |
34 | gettimeofday(&start_tv, NULL); | |
35 | # endif | |
36 | + | |
37 | + /* Handle being called recursively. This may happen for the session | |
38 | + * manager stuff, it may save the file, which does a breakcheck. */ | |
39 | + if (busy) | |
40 | + return 0; | |
41 | #endif | |
42 | ||
43 | #ifdef MAY_LOOP | |
44 | *************** | |
45 | *** 4111,4117 **** | |
46 | --- 4124,4134 ---- | |
47 | if (xsmp_idx >= 0 && (fds[xsmp_idx].revents & (POLLIN | POLLHUP))) | |
48 | { | |
49 | if (fds[xsmp_idx].revents & POLLIN) | |
50 | + { | |
51 | + busy = TRUE; | |
52 | xsmp_handle_requests(); | |
53 | + busy = FALSE; | |
54 | + } | |
55 | else if (fds[xsmp_idx].revents & POLLHUP) | |
56 | { | |
57 | if (p_verbose > 0) | |
58 | *************** | |
59 | *** 4247,4253 **** | |
60 | --- 4264,4272 ---- | |
61 | } | |
62 | else if (FD_ISSET(xsmp_icefd, &rfds)) | |
63 | { | |
64 | + busy = TRUE; | |
65 | xsmp_handle_requests(); | |
66 | + busy = FALSE; | |
67 | if (--ret == 0) | |
68 | finished = FALSE; /* keep going if event was only one */ | |
69 | } | |
70 | *************** | |
71 | *** 5793,5799 **** | |
72 | int interact_style; | |
73 | Bool fast; | |
74 | { | |
75 | ! /* Handle already biung in saveyourself */ | |
76 | if (xsmp.save_yourself) | |
77 | SmcSaveYourselfDone(smc_conn, True); | |
78 | xsmp.save_yourself = True; | |
79 | --- 5812,5818 ---- | |
80 | int interact_style; | |
81 | Bool fast; | |
82 | { | |
83 | ! /* Handle already being in saveyourself */ | |
84 | if (xsmp.save_yourself) | |
85 | SmcSaveYourselfDone(smc_conn, True); | |
86 | xsmp.save_yourself = True; | |
87 | *************** | |
88 | *** 5893,5898 **** | |
89 | --- 5912,5918 ---- | |
90 | xsmp_handle_requests() | |
91 | { | |
92 | Bool rep; | |
93 | + | |
94 | if (IceProcessMessages(xsmp.iceconn, NULL, &rep) | |
95 | == IceProcessMessagesIOError) | |
96 | { | |
97 | *** ../vim-6.2.017/src/version.c Mon Jun 30 22:31:05 2003 | |
98 | --- src/version.c Wed Jul 2 21:34:38 2003 | |
99 | *************** | |
100 | *** 632,633 **** | |
101 | --- 632,635 ---- | |
102 | { /* Add new patch number below this line */ | |
103 | + /**/ | |
104 | + 18, | |
105 | /**/ | |
106 | ||
107 | -- | |
108 | GALAHAD: No, please. Please! I can defeat them! There's only a hundred. | |
109 | GIRLS: He will beat us easily. We haven't a chance. | |
110 | "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD | |
111 | ||
112 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
113 | /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ | |
114 | \\\ Project leader for A-A-P -- http://www.A-A-P.org /// | |
115 | \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html /// |