(sieve_change_source)
(sieve_check_source_changed): New functions (sieve_code_action,sieve_code_test): Call sieve_check_source_changed.
Showing
1 changed file
with
23 additions
and
2 deletions
... | @@ -330,10 +330,30 @@ sieve_code_line (size_t line) | ... | @@ -330,10 +330,30 @@ sieve_code_line (size_t line) |
330 | || sieve_code (&op); | 330 | || sieve_code (&op); |
331 | } | 331 | } |
332 | 332 | ||
333 | static int sieve_source_changed; | ||
334 | |||
335 | void | ||
336 | sieve_change_source () | ||
337 | { | ||
338 | sieve_source_changed = 1; | ||
339 | } | ||
340 | |||
341 | static int | ||
342 | sieve_check_source_changed () | ||
343 | { | ||
344 | if (sieve_source_changed) | ||
345 | { | ||
346 | sieve_source_changed = 0; | ||
347 | return sieve_code_source (sieve_filename); | ||
348 | } | ||
349 | return 0; | ||
350 | } | ||
351 | |||
333 | int | 352 | int |
334 | sieve_code_action (mu_sieve_register_t *reg, mu_list_t arglist) | 353 | sieve_code_action (mu_sieve_register_t *reg, mu_list_t arglist) |
335 | { | 354 | { |
336 | return sieve_code_line (sieve_line_num) | 355 | return sieve_check_source_changed () |
356 | || sieve_code_line (sieve_line_num) | ||
337 | || sieve_code_instr (instr_action) | 357 | || sieve_code_instr (instr_action) |
338 | || sieve_code_command (reg, arglist); | 358 | || sieve_code_command (reg, arglist); |
339 | } | 359 | } |
... | @@ -341,7 +361,8 @@ sieve_code_action (mu_sieve_register_t *reg, mu_list_t arglist) | ... | @@ -341,7 +361,8 @@ sieve_code_action (mu_sieve_register_t *reg, mu_list_t arglist) |
341 | int | 361 | int |
342 | sieve_code_test (mu_sieve_register_t *reg, mu_list_t arglist) | 362 | sieve_code_test (mu_sieve_register_t *reg, mu_list_t arglist) |
343 | { | 363 | { |
344 | return sieve_code_line (sieve_line_num) | 364 | return sieve_check_source_changed () |
365 | || sieve_code_line (sieve_line_num) | ||
345 | || sieve_code_instr (instr_test) | 366 | || sieve_code_instr (instr_test) |
346 | || sieve_code_command (reg, arglist); | 367 | || sieve_code_command (reg, arglist); |
347 | } | 368 | } | ... | ... |
-
Please register or sign in to post a comment