]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
next-prime: Revert to original behaviour in GNU gettext.
authorBruno Haible <bruno@clisp.org>
Sat, 12 Jul 2025 11:54:00 +0000 (13:54 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 12 Jul 2025 11:54:23 +0000 (13:54 +0200)
Reported by Rocket Aaron <i@rocka.me> at
<https://savannah.gnu.org/bugs/?67305>.

* lib/next-prime.c (next_prime): In GNU gettext, don't skip small
primes.

ChangeLog
lib/next-prime.c

index ebc4ef2a640574208b018b56b43dd8c86dc1f28d..20229b3fd52cafdbb69bd4a15bd773bfaa544f72 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-07-12  Bruno Haible  <bruno@clisp.org>
+
+       next-prime: Revert to original behaviour in GNU gettext.
+       Reported by Rocket Aaron <i@rocka.me> at
+       <https://savannah.gnu.org/bugs/?67305>.
+       * lib/next-prime.c (next_prime): In GNU gettext, don't skip small
+       primes.
+
 2025-07-12  Bruno Haible  <bruno@clisp.org>
 
        obstack-printf: Fix memory overrun on glibc systems.
index 52cebc48d19ae364884f6c1ce4987eb130ad5477..58630db9b09f294232be783966e9d67c737ade76 100644 (file)
@@ -42,9 +42,11 @@ is_prime (size_t candidate)
 size_t _GL_ATTRIBUTE_CONST
 next_prime (size_t candidate)
 {
+#if !defined IN_LIBGETTEXTLIB
   /* Skip small primes.  */
   if (candidate < 10)
     candidate = 10;
+#endif
 
   /* Make it definitely odd.  */
   candidate |= 1;