+2012-01-29 Bruno Haible <bruno@clisp.org>
+
+ quotearg: Fix test failure on MacOS X 10.5.
+ * tests/test-quotearg-simple.c: Include localcharset.h.
+ (main): If the locale encoding is not ASCII, bypass the tests of
+ locale_quoting_style and clocale_quoting_style.
+ * modules/quotearg-tests (Depends-on): Add 'localcharset'.
+
2012-01-29 Jim Meyering <meyering@redhat.com>
maint.mk: sc_prohibit_canonicalize_without_use: avoid false positive
#include <stdlib.h>
#include <string.h>
+#include "localcharset.h"
#include "progname.h"
#include "macros.h"
for (i = literal_quoting_style; i <= clocale_quoting_style; i++)
{
set_quoting_style (NULL, (enum quoting_style) i);
- compare_strings (use_quotearg_buffer, &results_g[i].group1, ascii_only);
- compare_strings (use_quotearg, &results_g[i].group2, ascii_only);
- if (i == c_quoting_style)
- compare_strings (use_quote_double_quotes, &results_g[i].group2,
- ascii_only);
- compare_strings (use_quotearg_colon, &results_g[i].group3, ascii_only);
+ if (!(i == locale_quoting_style || i == clocale_quoting_style)
+ || (strcmp (locale_charset (), "ASCII") == 0
+ || strcmp (locale_charset (), "ANSI_X3.4-1968") == 0))
+ {
+ compare_strings (use_quotearg_buffer, &results_g[i].group1,
+ ascii_only);
+ compare_strings (use_quotearg, &results_g[i].group2,
+ ascii_only);
+ if (i == c_quoting_style)
+ compare_strings (use_quote_double_quotes, &results_g[i].group2,
+ ascii_only);
+ compare_strings (use_quotearg_colon, &results_g[i].group3,
+ ascii_only);
+ }
}
set_quoting_style (NULL, literal_quoting_style);