diff options
-rw-r--r-- | gettext-runtime/m4/printf-posix.m4 | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gettext-runtime/m4/printf-posix.m4 b/gettext-runtime/m4/printf-posix.m4 index d96c32c..0baee62 100644 --- a/gettext-runtime/m4/printf-posix.m4 +++ b/gettext-runtime/m4/printf-posix.m4 @@ -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, [ |