diff options
author | Daiki Ueno <ueno@gnu.org> | 2014-05-31 11:28:39 +0900 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2014-05-31 14:56:52 +0900 |
commit | 3a78eca9e7bd70521a0f64657b4c5904797927df (patch) | |
tree | 73061803fae529755ff55b9039e6aafe72fcc5cf /gettext-tools/src | |
parent | ce27989475881c28198c436ddb9855bdf0645e7f (diff) | |
download | external_gettext-3a78eca9e7bd70521a0f64657b4c5904797927df.zip external_gettext-3a78eca9e7bd70521a0f64657b4c5904797927df.tar.gz external_gettext-3a78eca9e7bd70521a0f64657b4c5904797927df.tar.bz2 |
msgfilter: Pass previous msgid to the child process
Suggested by Pavel Kharitonov in:
<http://lists.gnu.org/archive/html/bug-gettext/2014-05/msg00022.html>.
* msgfilter.c (process_message): Set MSGFILTER_PREV_* envvar.
Diffstat (limited to 'gettext-tools/src')
-rw-r--r-- | gettext-tools/src/ChangeLog | 7 | ||||
-rw-r--r-- | gettext-tools/src/msgfilter.c | 12 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 596e3a5..8247050 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,10 @@ +2014-05-31 Daiki Ueno <ueno@gnu.org> + + msgfilter: Pass previous msgid to the child process + Suggested by Pavel Kharitonov in: + <http://lists.gnu.org/archive/html/bug-gettext/2014-05/msg00022.html>. + * msgfilter.c (process_message): Set MSGFILTER_PREV_* envvar. + 2014-05-19 Daiki Ueno <ueno@gnu.org> * Makefile.am (po-gram-gen2.h): Adjust the directory to which diff --git a/gettext-tools/src/msgfilter.c b/gettext-tools/src/msgfilter.c index f172a45..961b1f1 100644 --- a/gettext-tools/src/msgfilter.c +++ b/gettext-tools/src/msgfilter.c @@ -671,6 +671,18 @@ process_message (message_ty *mp) (long) mp->pos.line_number); xsetenv ("MSGFILTER_LOCATION", location, 1); free (location); + if (mp->prev_msgctxt != NULL) + xsetenv ("MSGFILTER_PREV_MSGCTXT", mp->prev_msgctxt, 1); + else + unsetenv ("MSGFILTER_PREV_MSGCTXT"); + if (mp->prev_msgid != NULL) + xsetenv ("MSGFILTER_PREV_MSGID", mp->prev_msgid, 1); + else + unsetenv ("MSGFILTER_PREV_MSGID"); + if (mp->prev_msgid_plural != NULL) + xsetenv ("MSGFILTER_PREV_MSGID_PLURAL", mp->prev_msgid_plural, 1); + else + unsetenv ("MSGFILTER_PREV_MSGID_PLURAL"); /* Count NUL delimited substrings. */ for (p = msgstr, nsubstrings = 0; |