File: fix_get_uid-crasher.dpatch

package info (click to toggle)
evolution-sharp 0.17.1-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,892 kB
  • ctags: 875
  • sloc: sh: 8,987; cs: 2,700; ansic: 712; makefile: 183; xml: 28
file content (53 lines) | stat: -rw-r--r-- 1,876 bytes parent folder | download
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
#! /bin/sh /usr/share/dpatch/dpatch-run
## fix_get_uid-crasher.dpatch by  <jose@gimli.tribulaciones.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix for bug #475640. From evolution-sharp SVN r174

@DPATCH@
diff -urNad evolution-sharp-0.17.1~/evolution/src/CalComponent.cs evolution-sharp-0.17.1/evolution/src/CalComponent.cs
--- evolution-sharp-0.17.1~/evolution/src/CalComponent.cs	2008-03-02 07:17:27.000000000 +0100
+++ evolution-sharp-0.17.1/evolution/src/CalComponent.cs	2008-05-02 12:14:41.000000000 +0200
@@ -181,15 +181,17 @@
 		}
 
 		[DllImport("ecal")]
-			static extern void e_cal_component_get_uid (IntPtr handle, out string uid);
+			static extern void e_cal_component_get_uid (IntPtr handle, out IntPtr uid);
 		[DllImport("ecal")]
 			static extern void e_cal_component_set_uid (IntPtr handle, string uid);
 		
 		public string Uid {
 			get {
-				string uid = "";
-				e_cal_component_get_uid (Handle, out uid);
-				return uid;
+				IntPtr uid;
+			    	e_cal_component_get_uid (Handle, out uid);
+			    	string managed_uid = Marshal.PtrToStringAnsi (uid);
+
+			    	return managed_uid;
 			}
 			set {
 				e_cal_component_set_uid (Handle, value);
@@ -271,15 +273,17 @@
 		}
 
 		[DllImport("ecal")]
-			static extern void e_cal_component_get_location (IntPtr raw, out string location);
+			static extern void e_cal_component_get_location (IntPtr raw, out IntPtr location);
 		[DllImport("ecal")]
 			static extern void e_cal_component_set_location (IntPtr raw, string location);
 
 		public string Location {
 			get {
-				string location = "";
+				IntPtr location;
 				e_cal_component_get_location (Handle, out location);
-				return location;
+				string managed_location = Marshal.PtrToStringAnsi (location);
+
+				return managed_location;
 			}
 			set {
 				e_cal_component_set_location (Handle, value);