Fixes in wordsplit. Use wordsplit instead of vartab in movemail.
Eventually this will lead to vartab fading out until it is removed in some point in the future. Wordsplit provides a much better variable substitution mechanism. * include/mailutils/wordsplit.h (mu_wordsplit) <ws_getvar>: Change signature. <ws_closure>: New member. (MU_WRDSF_CLOSURE): New flag. * libmailutils/string/wordsplit.c (mu_wordsplit_init): Initialize ws_closure to NULL, unless MU_WRDSF_CLOSURE is set. Do not modify ws_wordn if MU_WRDSF_DOOFFS is set. (wsnode_remove): Clear _WSNF_JOIN on the previous node if the node being deleted is the last one in chain. (expvar): Pass ws_closure as 3rd argument to ws_getvar. Insert a NULL node if the variable is not defined. * movemail/movemail.c: Use wordsplit instead of vartab. Note a side effect: the "source:*" and "dest:*" variables are now written as "source_*" and "dest_*", correspondingly. (movemail_getvar_closure): New structure. (DCL_VTX): Remove macro and its uses. (get_url_part, movemail_getvar): New functions. (set_program_id): Rewrite using wordsplit.
Showing
3 changed files
with
96 additions
and
51 deletions
-
Please register or sign in to post a comment