diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2017-06-18 22:31:23 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2017-06-18 22:31:23 +0300 |
commit | 4264c894681d11d4a5ce694aa8040223726fad1e (patch) | |
tree | 68dc53621326bacec4c6f6c65d7c8f763212224d | |
parent | dfac76cd5d43f32c09e8fecd91184573610734ac (diff) | |
download | egawk-4264c894681d11d4a5ce694aa8040223726fad1e.tar.gz egawk-4264c894681d11d4a5ce694aa8040223726fad1e.tar.bz2 egawk-4264c894681d11d4a5ce694aa8040223726fad1e.zip |
Minor updates to gettext.h.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | gettext.h | 11 |
2 files changed, 9 insertions, 3 deletions
@@ -3,6 +3,7 @@ * builtin.c (mbc_char_count): Fix code to correctly traverse the string. Thanks to Hermann Peifer for the bug report. * config.guess, config.sub: Update to latest from GNULIB. + * gettext.h: Pull in a few nice changes from GNULIB version. 2017-05-30 Arnold D. Robbins <arnold@skeeve.com> @@ -193,7 +193,8 @@ npgettext_aux (const char *domain, #include <string.h> #if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \ - /* || __STDC_VERSION__ >= 199901L */ ) + /* || __STDC_VERSION__ == 199901L + || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ ) # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1 #else # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0 @@ -234,15 +235,17 @@ dcpgettext_expr (const char *domain, if (msg_ctxt_id != NULL) #endif { + int found_translation; memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcgettext (domain, msg_ctxt_id, category); + found_translation = (translation != msg_ctxt_id); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif - if (translation != msg_ctxt_id) + if (found_translation) return translation; } return msgid; @@ -280,15 +283,17 @@ dcnpgettext_expr (const char *domain, if (msg_ctxt_id != NULL) #endif { + int found_translation; memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + found_translation = !(translation == msg_ctxt_id || translation == msgid_plural); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif - if (!(translation == msg_ctxt_id || translation == msgid_plural)) + if (found_translation) return translation; } return (n == 1 ? msgid : msgid_plural); |