1 |
ssuominen 10/01/05 12:01:05 |
2 |
|
3 |
Added: licq-1.3.8-hebrew.patch |
4 |
licq-1.3.8-memory_leak.patch |
5 |
Log: |
6 |
Fix memory leak and hebrew support wrt #299734, thanks to Andy Crook for reporting. Remove USE="kde" since it's broken (upstream) with default Oxygen theme wrt #296929, thanks to Marcel Semancik for reporting. |
7 |
(Portage version: 2.2_rc61/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 net-im/licq/files/licq-1.3.8-hebrew.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-im/licq/files/licq-1.3.8-hebrew.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-im/licq/files/licq-1.3.8-hebrew.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: licq-1.3.8-hebrew.patch |
16 |
=================================================================== |
17 |
--- configure |
18 |
+++ configure |
19 |
@@ -3283,7 +3283,7 @@ |
20 |
|
21 |
# Check whether --enable-hebrew was given. |
22 |
if test "${enable_hebrew+set}" = set; then : |
23 |
- enableval=$enable_hebrew; USE_HEBREW=yes |
24 |
+ enableval=$enable_hebrew; USE_HEBREW=$enableval |
25 |
else |
26 |
USE_HEBREW=no |
27 |
fi |
28 |
--- src/hebrev.c |
29 |
+++ src/hebrev.c |
30 |
@@ -48,6 +48,7 @@ |
31 |
short int mode = 0, imode; |
32 |
const char *hmark = NULL, *lmark, *nmark, *nlmark; |
33 |
char ch; |
34 |
+ const char* srcstart = src; |
35 |
|
36 |
if (src == NULL) |
37 |
return NULL; |
38 |
@@ -69,7 +70,7 @@ |
39 |
if (*src == 0 || iseng(*src)) |
40 |
{ |
41 |
lmark = src-1; |
42 |
- while ((!isheb(*lmark)) && (!ispunct(*lmark))) lmark--; |
43 |
+ while (lmark > srcstart && !isheb(*lmark) && !ispunct(*lmark)) lmark--; |
44 |
src = lmark; |
45 |
imode = 0; |
46 |
nmark = NULL; |
47 |
@@ -114,6 +115,7 @@ |
48 |
hmark = NULL; |
49 |
mode = 0; |
50 |
} |
51 |
+ if (*src == '\0') *dest = '\0'; |
52 |
} |
53 |
if (!*src++) |
54 |
break; |
55 |
@@ -141,15 +143,16 @@ |
56 |
char *temp=NULL, *tmp=NULL; |
57 |
char *arg=NULL, *arg2=NULL; |
58 |
int i=0; |
59 |
+ char* saveptr = NULL; |
60 |
|
61 |
temp = (char*) malloc(strlen(input)+1); |
62 |
tmp = temp; |
63 |
|
64 |
strcpy(temp, input); |
65 |
|
66 |
- arg = strtok(temp, "\n"); |
67 |
+ arg = strtok_r(temp, "\n", &saveptr); |
68 |
for(i = 0; (i < index) && (arg!=NULL); i++) |
69 |
- arg = strtok(NULL, "\n"); |
70 |
+ arg = strtok_r(NULL, "\n", &saveptr); |
71 |
|
72 |
if(arg != NULL) |
73 |
{ |
74 |
@@ -164,6 +167,7 @@ |
75 |
{ |
76 |
char* temp_str = NULL; |
77 |
char* temp = NULL; |
78 |
+ char* arg = NULL; |
79 |
int i=0; |
80 |
int size = 0; |
81 |
if(src == NULL) |
82 |
@@ -172,21 +176,23 @@ |
83 |
if((temp_str = (char*)malloc(strlen(src)+1))== NULL) |
84 |
return NULL; |
85 |
|
86 |
- temp = GetArg(src, i); |
87 |
- while(temp != NULL) |
88 |
+ arg = GetArg(src, i); |
89 |
+ while(arg != NULL) |
90 |
{ |
91 |
i++; |
92 |
- temp = hebrew(temp); |
93 |
+ temp = hebrew(arg); |
94 |
+ free(arg); |
95 |
memcpy(temp_str + size , temp, strlen(temp)); |
96 |
size += strlen(temp) ; |
97 |
temp_str[size++] = '\n'; |
98 |
|
99 |
free(temp); |
100 |
temp = NULL; |
101 |
- temp = GetArg(src, i); |
102 |
+ arg = GetArg(src, i); |
103 |
} |
104 |
- free(temp); |
105 |
- temp_str[size]= '\0'; |
106 |
+ // Above loop adds a line break after last line that wasn't there in src |
107 |
+ // replace it with the null terminator |
108 |
+ temp_str[--size]= '\0'; |
109 |
return temp_str; |
110 |
} |
111 |
|
112 |
|
113 |
|
114 |
|
115 |
1.1 net-im/licq/files/licq-1.3.8-memory_leak.patch |
116 |
|
117 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-im/licq/files/licq-1.3.8-memory_leak.patch?rev=1.1&view=markup |
118 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-im/licq/files/licq-1.3.8-memory_leak.patch?rev=1.1&content-type=text/plain |
119 |
|
120 |
Index: licq-1.3.8-memory_leak.patch |
121 |
=================================================================== |
122 |
--- src/user.cpp |
123 |
+++ src/user.cpp |
124 |
@@ -3631,6 +3631,7 @@ |
125 |
{ |
126 |
gLog.Error("%sUnable to open picture file (%s):\n%s%s.\n", L_ERRORxSTR, |
127 |
szFilename, L_BLANKxSTR, strerror(errno)); |
128 |
+ close(source); |
129 |
return; |
130 |
} |