OCaml 4.14.0 rebuild
[arch-packages.git] / claws-mail / repos / extra-x86_64 / 20cope_with_fix_for_1009149.patch
blobf92114ae54d85e6159209a31fa921620a818df4a
1 Description: the perl fix¹ for bug #1009149 disallows the use
2 of XSRETURN_* macros in expressions, hence all of them have to
3 be rewritten. Thanks to Andreas Rönnquist for the heads up!
4 ¹ https://salsa.debian.org/perl-team/interpreter/perl/-/commit/c949a3d4176ec66493af1aa87c1dc64fc6127bb6
5 Author: Ricardo Mones <mones@debian.org>
6 Last-Updated: 2022-04-12
8 diff --git a/src/plugins/perl/perl_plugin.c b/src/plugins/perl/perl_plugin.c
9 index 1ac005e1..ee9e15f2 100644
10 --- a/src/plugins/perl/perl_plugin.c
11 +++ b/src/plugins/perl/perl_plugin.c
12 @@ -577,76 +577,182 @@ static XS(XS_ClawsMail_filter_init)
14 /* msginfo */
15 case 1:
16 - msginfo->size ? XSRETURN_UV(msginfo->size) : XSRETURN_UNDEF;
17 + if (msginfo->size) {
18 + XSRETURN_UV(msginfo->size);
19 + }
20 + else {
21 + XSRETURN_UNDEF;
22 + }
23 case 2:
24 - msginfo->date ? XSRETURN_PV(msginfo->date) : XSRETURN_UNDEF;
25 + if (msginfo->date) {
26 + XSRETURN_PV(msginfo->date);
27 + }
28 + else {
29 + XSRETURN_UNDEF;
30 + }
31 case 3:
32 - msginfo->from ? XSRETURN_PV(msginfo->from) : XSRETURN_UNDEF;
33 + if (msginfo->from) {
34 + XSRETURN_PV(msginfo->from);
35 + }
36 + else {
37 + XSRETURN_UNDEF;
38 + }
39 case 4:
40 - msginfo->to ? XSRETURN_PV(msginfo->to) : XSRETURN_UNDEF;
41 + if (msginfo->to) {
42 + XSRETURN_PV(msginfo->to);
43 + }
44 + else {
45 + XSRETURN_UNDEF;
46 + }
47 case 5:
48 - msginfo->cc ? XSRETURN_PV(msginfo->cc) : XSRETURN_UNDEF;
49 + if (msginfo->cc) {
50 + XSRETURN_PV(msginfo->cc);
51 + }
52 + else {
53 + XSRETURN_UNDEF;
54 + }
55 case 6:
56 - msginfo->newsgroups ? XSRETURN_PV(msginfo->newsgroups) : XSRETURN_UNDEF;
57 + if (msginfo->newsgroups) {
58 + XSRETURN_PV(msginfo->newsgroups);
59 + }
60 + else {
61 + XSRETURN_UNDEF;
62 + }
63 case 7:
64 - msginfo->subject ? XSRETURN_PV(msginfo->subject) : XSRETURN_UNDEF;
65 + if (msginfo->subject) {
66 + XSRETURN_PV(msginfo->subject);
67 + }
68 + else {
69 + XSRETURN_UNDEF;
70 + }
71 case 8:
72 - msginfo->msgid ? XSRETURN_PV(msginfo->msgid) : XSRETURN_UNDEF;
73 + if (msginfo->msgid) {
74 + XSRETURN_PV(msginfo->msgid);
75 + }
76 + else {
77 + XSRETURN_UNDEF;
78 + }
79 case 9:
80 - msginfo->inreplyto ? XSRETURN_PV(msginfo->inreplyto) : XSRETURN_UNDEF;
81 + if (msginfo->inreplyto) {
82 + XSRETURN_PV(msginfo->inreplyto);
83 + }
84 + else {
85 + XSRETURN_UNDEF;
86 + }
87 case 10:
88 - msginfo->xref ? XSRETURN_PV(msginfo->xref) : XSRETURN_UNDEF;
89 + if (msginfo->xref) {
90 + XSRETURN_PV(msginfo->xref);
91 + }
92 + else {
93 + XSRETURN_UNDEF;
94 + }
95 case 11:
96 xface = procmsg_msginfo_get_avatar(msginfo, AVATAR_XFACE);
97 - xface ? XSRETURN_PV(xface) : XSRETURN_UNDEF;
98 + if (xface) {
99 + XSRETURN_PV(xface);
101 + else {
102 + XSRETURN_UNDEF;
104 case 12:
105 - (msginfo->extradata && msginfo->extradata->dispositionnotificationto) ?
106 - XSRETURN_PV(msginfo->extradata->dispositionnotificationto) : XSRETURN_UNDEF;
107 + if (msginfo->extradata && msginfo->extradata->dispositionnotificationto) {
108 + XSRETURN_PV(msginfo->extradata->dispositionnotificationto);
110 + else {
111 + XSRETURN_UNDEF;
113 case 13:
114 - (msginfo->extradata && msginfo->extradata->returnreceiptto) ?
115 - XSRETURN_PV(msginfo->extradata->returnreceiptto) : XSRETURN_UNDEF;
116 + if (msginfo->extradata && msginfo->extradata->returnreceiptto) {
117 + XSRETURN_PV(msginfo->extradata->returnreceiptto);
119 + else {
120 + XSRETURN_UNDEF;
122 case 14:
123 EXTEND(SP, g_slist_length(msginfo->references));
124 ii = 0;
125 for(walk = msginfo->references; walk != NULL; walk = g_slist_next(walk))
126 XST_mPV(ii++,walk->data ? (gchar*) walk->data: "");
127 - ii ? XSRETURN(ii) : XSRETURN_UNDEF;
128 + if (ii) {
129 + XSRETURN(ii);
131 + else {
132 + XSRETURN_UNDEF;
134 case 15:
135 - msginfo->score ? XSRETURN_IV(msginfo->score) : XSRETURN_UNDEF;
136 + if (msginfo->score) {
137 + XSRETURN_IV(msginfo->score);
139 + else {
140 + XSRETURN_UNDEF;
142 case 17:
143 - msginfo->plaintext_file ?
144 - XSRETURN_PV(msginfo->plaintext_file) : XSRETURN_UNDEF;
145 + if (msginfo->plaintext_file) {
146 + XSRETURN_PV(msginfo->plaintext_file);
148 + else {
149 + XSRETURN_UNDEF;
151 case 19:
152 - msginfo->hidden ? XSRETURN_IV(msginfo->hidden) : XSRETURN_UNDEF;
153 + if (msginfo->hidden) {
154 + XSRETURN_IV(msginfo->hidden);
156 + else {
157 + XSRETURN_UNDEF;
159 case 20:
160 if((charp = procmsg_get_message_file_path(msginfo)) != NULL) {
161 strncpy2(buf,charp,sizeof(buf));
162 g_free(charp);
163 XSRETURN_PV(buf);
165 - else
166 + else {
167 XSRETURN_UNDEF;
169 case 21:
170 - (msginfo->extradata && msginfo->extradata->partial_recv) ?
171 - XSRETURN_PV(msginfo->extradata->partial_recv) : XSRETURN_UNDEF;
172 + if (msginfo->extradata && msginfo->extradata->partial_recv) {
173 + XSRETURN_PV(msginfo->extradata->partial_recv);
175 + else {
176 + XSRETURN_UNDEF;
178 case 22:
179 - msginfo->total_size ? XSRETURN_IV(msginfo->total_size) : XSRETURN_UNDEF;
180 + if (msginfo->total_size) {
181 + XSRETURN_IV(msginfo->total_size);
183 + else {
184 + XSRETURN_UNDEF;
186 case 23:
187 - (msginfo->extradata && msginfo->extradata->account_server) ?
188 - XSRETURN_PV(msginfo->extradata->account_server) : XSRETURN_UNDEF;
189 + if (msginfo->extradata && msginfo->extradata->account_server) {
190 + XSRETURN_PV(msginfo->extradata->account_server);
192 + else {
193 + XSRETURN_UNDEF;
195 case 24:
196 - (msginfo->extradata && msginfo->extradata->account_login) ?
197 - XSRETURN_PV(msginfo->extradata->account_login) : XSRETURN_UNDEF;
198 + if (msginfo->extradata && msginfo->extradata->account_login) {
199 + XSRETURN_PV(msginfo->extradata->account_login);
201 + else {
202 + XSRETURN_UNDEF;
204 case 25:
205 - msginfo->planned_download ?
206 - XSRETURN_IV(msginfo->planned_download) : XSRETURN_UNDEF;
207 + if (msginfo->planned_download) {
208 + XSRETURN_IV(msginfo->planned_download);
210 + else {
211 + XSRETURN_UNDEF;
214 /* general */
215 case 100:
216 - if(manual_filtering)
217 + if(manual_filtering) {
218 XSRETURN_YES;
219 - else
221 + else {
222 XSRETURN_NO;
224 default:
225 g_warning("Perl plugin: wrong argument to ClawsMail::C::init");
226 XSRETURN_UNDEF;
227 @@ -664,8 +770,9 @@ static XS(XS_ClawsMail_open_mail_file)
228 XSRETURN_UNDEF;
230 file = procmsg_get_message_file_path(msginfo);
231 - if(!file)
232 + if(!file) {
233 XSRETURN_UNDEF;
235 if((message_file = claws_fopen(file, "rb")) == NULL) {
236 FILE_OP_ERROR(file, "claws_fopen");
237 g_warning("Perl plugin: file open error in ClawsMail::C::open_mail_file");
238 @@ -718,8 +825,9 @@ static XS(XS_ClawsMail_get_next_header)
239 g_free(buf);
240 XSRETURN(2);
242 - else
243 + else {
244 XSRETURN_EMPTY;
248 /* ClawsMail::C::get_next_body_line */
249 @@ -736,10 +844,12 @@ static XS(XS_ClawsMail_get_next_body_line)
250 g_warning("Perl plugin: message file not open. Use ClawsMail::C::open_message_file first");
251 XSRETURN_UNDEF;
253 - if(claws_fgets(buf, sizeof(buf), message_file) != NULL)
254 + if(claws_fgets(buf, sizeof(buf), message_file) != NULL) {
255 XSRETURN_PV(buf);
256 - else
258 + else {
259 XSRETURN_UNDEF;
264 @@ -772,57 +882,65 @@ static XS(XS_ClawsMail_check_flag)
265 filter_log_write(LOG_MATCH,"marked");
266 XSRETURN_YES;
268 - else
269 + else {
270 XSRETURN_NO;
272 case 2:
273 if(MSG_IS_UNREAD(msginfo->flags)) {
274 filter_log_write(LOG_MATCH,"unread");
275 XSRETURN_YES;
277 - else
278 + else {
279 XSRETURN_NO;
281 case 3:
282 if(MSG_IS_DELETED(msginfo->flags)) {
283 filter_log_write(LOG_MATCH,"deleted");
284 XSRETURN_YES;
286 - else
287 + else {
288 XSRETURN_NO;
290 case 4:
291 if(MSG_IS_NEW(msginfo->flags)) {
292 filter_log_write(LOG_MATCH,"new");
293 XSRETURN_YES;
295 - else
296 + else {
297 XSRETURN_NO;
299 case 5:
300 if(MSG_IS_REPLIED(msginfo->flags)) {
301 filter_log_write(LOG_MATCH,"replied");
302 XSRETURN_YES;
304 - else
305 + else {
306 XSRETURN_NO;
308 case 6:
309 if(MSG_IS_FORWARDED(msginfo->flags)) {
310 filter_log_write(LOG_MATCH,"forwarded");
311 XSRETURN_YES;
313 - else
314 + else {
315 XSRETURN_NO;
317 case 7:
318 if(MSG_IS_LOCKED(msginfo->flags)) {
319 filter_log_write(LOG_MATCH,"locked");
320 XSRETURN_YES;
322 - else
323 + else {
324 XSRETURN_NO;
326 case 8:
327 if(MSG_IS_IGNORE_THREAD(msginfo->flags)) {
328 filter_log_write(LOG_MATCH,"ignore_thread");
329 XSRETURN_YES;
331 - else
332 + else {
333 XSRETURN_NO;
335 default:
336 g_warning("Perl plugin: unknown argument to ClawsMail::C::check_flag");
337 XSRETURN_UNDEF;
338 @@ -845,8 +963,9 @@ static XS(XS_ClawsMail_colorlabel)
339 filter_log_write(LOG_MATCH,"colorlabel");
340 XSRETURN_YES;
342 - else
343 + else {
344 XSRETURN_NO;
348 /* ClawsMail::C::age_greater(int) */
349 @@ -866,8 +985,9 @@ static XS(XS_ClawsMail_age_greater)
350 filter_log_write(LOG_MATCH,"age_greater");
351 XSRETURN_YES;
353 - else
354 + else {
355 XSRETURN_NO;
359 /* ClawsMail::C::age_lower(int) */
360 @@ -887,8 +1007,9 @@ static XS(XS_ClawsMail_age_lower)
361 filter_log_write(LOG_MATCH,"age_lower");
362 XSRETURN_YES;
364 - else
365 + else {
366 XSRETURN_NO;
370 /* ClawsMail::C::tagged() */
371 @@ -900,7 +1021,12 @@ static XS(XS_ClawsMail_tagged)
372 XSRETURN_UNDEF;
375 - return msginfo->tags ? XSRETURN_YES : XSRETURN_NO;
376 + if (msginfo->tags) {
377 + XSRETURN_YES;
379 + else {
380 + XSRETURN_NO;
384 /* ClawsMail::C::get_tags() */
385 @@ -1032,10 +1158,12 @@ static XS(XS_ClawsMail_make_sure_folder_exists)
387 identifier = SvPV_nolen(ST(0));
388 item = folder_get_item_from_identifier(identifier);
389 - if(item)
390 + if(item) {
391 XSRETURN_YES;
392 - else
394 + else {
395 XSRETURN_NO;
400 @@ -1066,8 +1194,9 @@ static XS(XS_ClawsMail_addr_in_addressbook)
401 filter_log_write(LOG_MATCH,"addr_in_addressbook");
402 XSRETURN_YES;
404 - else
405 + else {
406 XSRETURN_NO;
411 @@ -1348,8 +1477,9 @@ static XS(XS_ClawsMail_forward)
413 XSRETURN_YES;
415 - else
416 + else {
417 XSRETURN_UNDEF;
421 /* ClawsMail::C::redirect(int,char*) */
422 @@ -1373,8 +1503,9 @@ static XS(XS_ClawsMail_redirect)
423 account = account_find_from_id(account_id);
424 compose = compose_redirect(account, msginfo, TRUE);
426 - if (compose->account->protocol == A_NNTP)
427 + if (compose->account->protocol == A_NNTP) {
428 XSRETURN_UNDEF;
430 else
431 compose_entry_append(compose, dest, COMPOSE_TO, PREF_NONE);
433 @@ -1389,8 +1520,9 @@ static XS(XS_ClawsMail_redirect)
435 XSRETURN_YES;
437 - else
438 + else {
439 XSRETURN_UNDEF;
444 @@ -1472,8 +1604,9 @@ static XS(XS_ClawsMail_get_attribute_value)
445 attribute_value = get_attribute_value(addr,attr,bookname);
448 - if(attribute_value)
449 + if(attribute_value) {
450 XSRETURN_PV(attribute_value);
452 XSRETURN_PV("");