1 |
pacho 12/03/04 09:54:46 |
2 |
|
3 |
Added: biew-610-crash.patch |
4 |
Log: |
5 |
Prevent crashes, bug #382033 by Nico R. Drop broken version. |
6 |
|
7 |
(Portage version: 2.1.10.49/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 dev-util/biew/files/biew-610-crash.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/biew/files/biew-610-crash.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/biew/files/biew-610-crash.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: biew-610-crash.patch |
16 |
=================================================================== |
17 |
If .biewrc does not exist, the setup dialog appears at program start. If you try |
18 |
to click a checkbox with the mouse, biew tries to dereference a null pointer |
19 |
(because the MainWindow is not yet set). |
20 |
|
21 |
This patch adds a workaround. Note that you actually cannot click a checkbox. |
22 |
But that is what users might expect. (Maybe the biew code should be changed to |
23 |
handle this properly.) Well, it is better not to crash, even if the checkboxes |
24 |
are not clickable. |
25 |
|
26 |
–nico |
27 |
|
28 |
|
29 |
diff -Naur biew-610.orig/events.c biew-610/events.c |
30 |
--- biew-610.orig/events.c 2009-09-03 16:57:40.000000000 +0000 |
31 |
+++ biew-610/events.c 2011-09-06 09:41:01.000000000 +0000 |
32 |
@@ -118,7 +118,11 @@ |
33 |
} |
34 |
else |
35 |
{ |
36 |
- X1 = 0; X2 = twGetClientWidth(MainWnd); Y1 = 1; Y2 = twGetClientHeight(MainWnd) - 1; |
37 |
+ TWindow *wnd = |
38 |
+ MainWnd ? MainWnd : /*XXX:drop this line?*/ |
39 |
+ twGetWinAtPos(mx, my); |
40 |
+ if(!wnd) return KE_MOUSE; |
41 |
+ X1 = 0; X2 = twGetClientWidth(wnd); Y1 = 1; Y2 = twGetClientHeight(wnd) - 1; |
42 |
} |
43 |
wdh = X2 - X1; |
44 |
hght = Y2 - Y1; |