aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--builtin.c3
-rwxr-xr-xconfig.guess19
-rwxr-xr-xconfig.sub6
-rw-r--r--extension/build-aux/ChangeLog4
-rwxr-xr-xextension/build-aux/config.guess19
-rwxr-xr-xextension/build-aux/config.sub6
-rw-r--r--gettext.h11
-rw-r--r--support/ChangeLog4
-rw-r--r--support/intprops.h6
-rw-r--r--test/ChangeLog5
-rw-r--r--test/Makefile.am12
-rw-r--r--test/Makefile.in12
-rw-r--r--test/mbprintf5.awk1
-rw-r--r--test/mbprintf5.in3
-rw-r--r--test/mbprintf5.ok3
16 files changed, 96 insertions, 25 deletions
diff --git a/ChangeLog b/ChangeLog
index 3bc5dc51..25ef75ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-06-18 Arnold D. Robbins <arnold@skeeve.com>
+
+ * 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>
* NEWS: Mention PROCINFO["argv"].
diff --git a/builtin.c b/builtin.c
index 87d9dcb8..724be058 100644
--- a/builtin.c
+++ b/builtin.c
@@ -4152,12 +4152,13 @@ mbc_char_count(const char *ptr, size_t numbytes)
if (mb_len <= 0)
return numbytes; /* no valid m.b. char */
- for (; numbytes > 0; numbytes--) {
+ while (numbytes > 0) {
mb_len = mbrlen(ptr, numbytes, &cur_state);
if (mb_len <= 0)
break;
sum++;
ptr += mb_len;
+ numbytes -= mb_len;
}
return sum;
diff --git a/config.guess b/config.guess
index 69ed3e57..2193702b 100755
--- a/config.guess
+++ b/config.guess
@@ -2,7 +2,7 @@
# Attempt to guess a canonical system name.
# Copyright 1992-2017 Free Software Foundation, Inc.
-timestamp='2017-03-05'
+timestamp='2017-05-27'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -1304,14 +1304,21 @@ EOF
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_PPC >/dev/null
+ then
+ UNAME_PROCESSOR=powerpc
+ fi
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# Avoid executing cc on OS X 10.9, as it ships with a stub
@@ -1335,16 +1342,16 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
+ NEO-*:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
+ NSR-*:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit ;;
- NSX-?:NONSTOP_KERNEL:*:*)
+ NSX-*:NONSTOP_KERNEL:*:*)
echo nsx-tandem-nsk${UNAME_RELEASE}
exit ;;
*:NonStop-UX:*:*)
diff --git a/config.sub b/config.sub
index 7203bf1e..40ea5dfe 100755
--- a/config.sub
+++ b/config.sub
@@ -2,7 +2,7 @@
# Configuration validation subroutine script.
# Copyright 1992-2017 Free Software Foundation, Inc.
-timestamp='2017-03-21'
+timestamp='2017-04-02'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -263,7 +263,7 @@ case $basic_machine in
| fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
- | i370 | i860 | i960 | ia64 \
+ | i370 | i860 | i960 | ia16 | ia64 \
| ip2k | iq2000 \
| k1om \
| le32 | le64 \
@@ -389,7 +389,7 @@ case $basic_machine in
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
+ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
| ip2k-* | iq2000-* \
| k1om-* \
| le32-* | le64-* \
diff --git a/extension/build-aux/ChangeLog b/extension/build-aux/ChangeLog
index 0851fdf4..4e4f0387 100644
--- a/extension/build-aux/ChangeLog
+++ b/extension/build-aux/ChangeLog
@@ -1,3 +1,7 @@
+2017-06-18 Arnold D. Robbins <arnold@skeeve.com>
+
+ * config.guess, config.sub: Update to latest from GNULIB.
+
2017-03-23 Arnold D. Robbins <arnold@skeeve.com>
* config.sub: Updated again.
diff --git a/extension/build-aux/config.guess b/extension/build-aux/config.guess
index 69ed3e57..2193702b 100755
--- a/extension/build-aux/config.guess
+++ b/extension/build-aux/config.guess
@@ -2,7 +2,7 @@
# Attempt to guess a canonical system name.
# Copyright 1992-2017 Free Software Foundation, Inc.
-timestamp='2017-03-05'
+timestamp='2017-05-27'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -1304,14 +1304,21 @@ EOF
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_PPC >/dev/null
+ then
+ UNAME_PROCESSOR=powerpc
+ fi
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# Avoid executing cc on OS X 10.9, as it ships with a stub
@@ -1335,16 +1342,16 @@ EOF
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
+ NEO-*:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
+ NSR-*:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit ;;
- NSX-?:NONSTOP_KERNEL:*:*)
+ NSX-*:NONSTOP_KERNEL:*:*)
echo nsx-tandem-nsk${UNAME_RELEASE}
exit ;;
*:NonStop-UX:*:*)
diff --git a/extension/build-aux/config.sub b/extension/build-aux/config.sub
index 7203bf1e..40ea5dfe 100755
--- a/extension/build-aux/config.sub
+++ b/extension/build-aux/config.sub
@@ -2,7 +2,7 @@
# Configuration validation subroutine script.
# Copyright 1992-2017 Free Software Foundation, Inc.
-timestamp='2017-03-21'
+timestamp='2017-04-02'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -263,7 +263,7 @@ case $basic_machine in
| fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
- | i370 | i860 | i960 | ia64 \
+ | i370 | i860 | i960 | ia16 | ia64 \
| ip2k | iq2000 \
| k1om \
| le32 | le64 \
@@ -389,7 +389,7 @@ case $basic_machine in
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
+ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
| ip2k-* | iq2000-* \
| k1om-* \
| le32-* | le64-* \
diff --git a/gettext.h b/gettext.h
index 474419ac..b3e8d876 100644
--- a/gettext.h
+++ b/gettext.h
@@ -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);
diff --git a/support/ChangeLog b/support/ChangeLog
index e2077bd0..54756048 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,3 +1,7 @@
+2017-06-18 Arnold D. Robbins <arnold@skeeve.com>
+
+ * intprops.h: Sync with GNULIB.
+
2017-05-22 Arnold D. Robbins <arnold@skeeve.com>
* dfa.c, dfa.h, intprops.h, verify.h: Sync with GNULIB.
diff --git a/support/intprops.h b/support/intprops.h
index d8c71206..33a7ec5a 100644
--- a/support/intprops.h
+++ b/support/intprops.h
@@ -219,7 +219,11 @@
: (max) >> (b) < (a))
/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */
-#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__)
+#if 5 <= __GNUC__ && !defined __ICC
+# define _GL_HAS_BUILTIN_OVERFLOW 1
+#else
+# define _GL_HAS_BUILTIN_OVERFLOW 0
+#endif
/* True if __builtin_add_overflow_p (A, B, C) works. */
#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
diff --git a/test/ChangeLog b/test/ChangeLog
index 0d8978fe..d2dd6abd 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-18 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (mbprintf5): New test.
+ * mbprintf5.awk, mbprintf5.in, mbprintf5.ok: New files.
+
2017-05-24 Andrew J. Schorr <aschorr@telemetry-investments.com>
* fwtest8.ok: Fix field number in error message, thanks to a bug
diff --git a/test/Makefile.am b/test/Makefile.am
index 443580b5..1fcdba3d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -626,6 +626,9 @@ EXTRA_DIST = \
mbprintf4.awk \
mbprintf4.in \
mbprintf4.ok \
+ mbprintf5.awk \
+ mbprintf5.in \
+ mbprintf5.ok \
mbstr1.awk \
mbstr1.ok \
mbstr2.awk \
@@ -1283,7 +1286,8 @@ MPFR_TESTS = mpfrnr mpfrnegzero mpfrmemok1 mpfrrem mpfrrnd mpfrieee \
LOCALE_CHARSET_TESTS = \
asort asorti backbigs1 backsmalls1 backsmalls2 \
fmttest fnarydel fnparydl jarebug lc_num1 mbfw1 \
- mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc
+ mbprintf1 mbprintf2 mbprintf3 mbprintf4 mbprintf5 \
+ rebt8b2 rtlenmb sort1 sprintfc
SHLIB_TESTS = \
apiterm fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \
@@ -1905,6 +1909,12 @@ mbprintf4::
$(AWK) -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mbprintf5::
+ @echo $@
+ @GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \
+ $(AWK) -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
mbfw1::
@echo $@
@GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \
diff --git a/test/Makefile.in b/test/Makefile.in
index e3fe9cbe..7bddf5a9 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -884,6 +884,9 @@ EXTRA_DIST = \
mbprintf4.awk \
mbprintf4.in \
mbprintf4.ok \
+ mbprintf5.awk \
+ mbprintf5.in \
+ mbprintf5.ok \
mbstr1.awk \
mbstr1.ok \
mbstr2.awk \
@@ -1536,7 +1539,8 @@ MPFR_TESTS = mpfrnr mpfrnegzero mpfrmemok1 mpfrrem mpfrrnd mpfrieee \
LOCALE_CHARSET_TESTS = \
asort asorti backbigs1 backsmalls1 backsmalls2 \
fmttest fnarydel fnparydl jarebug lc_num1 mbfw1 \
- mbprintf1 mbprintf2 mbprintf3 mbprintf4 rebt8b2 rtlenmb sort1 sprintfc
+ mbprintf1 mbprintf2 mbprintf3 mbprintf4 mbprintf5 \
+ rebt8b2 rtlenmb sort1 sprintfc
SHLIB_TESTS = \
apiterm fnmatch filefuncs fork fork2 fts functab4 getfile inplace1 inplace2 inplace3 \
@@ -2345,6 +2349,12 @@ mbprintf4::
$(AWK) -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mbprintf5::
+ @echo $@
+ @GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \
+ $(AWK) -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
mbfw1::
@echo $@
@GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \
diff --git a/test/mbprintf5.awk b/test/mbprintf5.awk
new file mode 100644
index 00000000..c9a57b48
--- /dev/null
+++ b/test/mbprintf5.awk
@@ -0,0 +1 @@
+{printf "%-5s%s\n", $1, $2}
diff --git a/test/mbprintf5.in b/test/mbprintf5.in
new file mode 100644
index 00000000..c63daaf6
--- /dev/null
+++ b/test/mbprintf5.in
@@ -0,0 +1,3 @@
+Ö ABC
+• ABC
+🜁 ABC
diff --git a/test/mbprintf5.ok b/test/mbprintf5.ok
new file mode 100644
index 00000000..252d95e6
--- /dev/null
+++ b/test/mbprintf5.ok
@@ -0,0 +1,3 @@
+Ö ABC
+• ABC
+🜁 ABC