Added missing NLS markers.
(builtin_concat,builtin_printstr): New functions.
Showing
1 changed file
with
29 additions
and
3 deletions
... | @@ -419,7 +419,7 @@ mh_format (mh_format_t *fmt, message_t msg, size_t msgno, | ... | @@ -419,7 +419,7 @@ mh_format (mh_format_t *fmt, message_t msg, size_t msgno, |
419 | break; | 419 | break; |
420 | 420 | ||
421 | default: | 421 | default: |
422 | mh_error ("Unknown opcode: %x", opcode); | 422 | mh_error (_("Unknown opcode: %x"), opcode); |
423 | abort (); | 423 | abort (); |
424 | } | 424 | } |
425 | } | 425 | } |
... | @@ -733,7 +733,7 @@ builtin_divide (struct mh_machine *mach) | ... | @@ -733,7 +733,7 @@ builtin_divide (struct mh_machine *mach) |
733 | { | 733 | { |
734 | if (!mach->arg_num) | 734 | if (!mach->arg_num) |
735 | { | 735 | { |
736 | mh_error ("format: divide by zero"); | 736 | mh_error (_("format: divide by zero")); |
737 | mach->stop = 1; | 737 | mach->stop = 1; |
738 | } | 738 | } |
739 | else | 739 | else |
... | @@ -745,7 +745,7 @@ builtin_modulo (struct mh_machine *mach) | ... | @@ -745,7 +745,7 @@ builtin_modulo (struct mh_machine *mach) |
745 | { | 745 | { |
746 | if (!mach->arg_num) | 746 | if (!mach->arg_num) |
747 | { | 747 | { |
748 | mh_error ("format: divide by zero"); | 748 | mh_error (_("format: divide by zero")); |
749 | mach->stop = 1; | 749 | mach->stop = 1; |
750 | } | 750 | } |
751 | else | 751 | else |
... | @@ -1640,6 +1640,30 @@ builtin_rcpt (struct mh_machine *mach) | ... | @@ -1640,6 +1640,30 @@ builtin_rcpt (struct mh_machine *mach) |
1640 | mach->arg_num = rc & rcpt_mask; | 1640 | mach->arg_num = rc & rcpt_mask; |
1641 | } | 1641 | } |
1642 | 1642 | ||
1643 | static void | ||
1644 | builtin_concat (struct mh_machine *mach) | ||
1645 | { | ||
1646 | if (strobj_len (&mach->reg_str) == 0) | ||
1647 | strobj_copy (&mach->reg_str, &mach->arg_str); | ||
1648 | else | ||
1649 | { | ||
1650 | int length = 1; | ||
1651 | |||
1652 | length += 1 + strobj_len (&mach->reg_str); /* reserve en extra space */ | ||
1653 | length += strobj_len (&mach->arg_str); | ||
1654 | strobj_realloc (&mach->reg_str, length); | ||
1655 | strcat (strcat (strobj_ptr (&mach->reg_str), " "), | ||
1656 | strobj_ptr (&mach->arg_str)); | ||
1657 | } | ||
1658 | } | ||
1659 | |||
1660 | static void | ||
1661 | builtin_printstr (struct mh_machine *mach) | ||
1662 | { | ||
1663 | print_obj (mach, mach->reg_num, &mach->arg_str); | ||
1664 | print_obj (mach, mach->reg_num, &mach->reg_str); | ||
1665 | } | ||
1666 | |||
1643 | /* Builtin function table */ | 1667 | /* Builtin function table */ |
1644 | 1668 | ||
1645 | mh_builtin_t builtin_tab[] = { | 1669 | mh_builtin_t builtin_tab[] = { |
... | @@ -1717,6 +1741,8 @@ mh_builtin_t builtin_tab[] = { | ... | @@ -1717,6 +1741,8 @@ mh_builtin_t builtin_tab[] = { |
1717 | { "putaddr", builtin_putaddr, mhtype_none, mhtype_str }, | 1741 | { "putaddr", builtin_putaddr, mhtype_none, mhtype_str }, |
1718 | { "unre", builtin_unre, mhtype_str, mhtype_str }, | 1742 | { "unre", builtin_unre, mhtype_str, mhtype_str }, |
1719 | { "rcpt", builtin_rcpt, mhtype_num, mhtype_str }, | 1743 | { "rcpt", builtin_rcpt, mhtype_num, mhtype_str }, |
1744 | { "concat", builtin_concat, mhtype_none, mhtype_str, 1 }, | ||
1745 | { "printstr", builtin_printstr, mhtype_none, mhtype_str }, | ||
1720 | { 0 } | 1746 | { 0 } |
1721 | }; | 1747 | }; |
1722 | 1748 | ... | ... |
-
Please register or sign in to post a comment