]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Work around an autoconf problem.
authorBruno Haible <bruno@clisp.org>
Thu, 19 Jun 2003 15:58:21 +0000 (15:58 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:10:43 +0000 (12:10 +0200)
gettext-runtime/m4/printf-posix.m4

index d96c32c824c565b7a2b74d8a6dcfea8bfe890d2b..0baee6297ff2b6c3ee8a5594fbbb26ac5e43ded2 100644 (file)
@@ -19,11 +19,14 @@ AC_DEFUN([gt_PRINTF_POSIX],
       AC_TRY_RUN([
 #include <stdio.h>
 #include <string.h>
+/* The string "%2$d %1$d", with dollar characters protected from the shell's
+   dollar expansion (possibly an autoconf bug).  */
+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
 static char buf[100];
 int main ()
 {
-  sprintf (buf, "%2$d %1$d", 33, 55);
-  return (strcmp (buf, "55 33") == 0);
+  sprintf (buf, format, 33, 55);
+  return (strcmp (buf, "55 33") != 0);
 }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
       [
         AC_EGREP_CPP(notposix, [