summaryrefslogtreecommitdiff
path: root/lib/quotearg.c
AgeCommit message (Collapse)Author
2005-05-14Update FSF postal mail address.Jim Meyering
2004-11-11Sync from gnulib.Paul Eggert
2004-08-02Include stdbool.h.Paul Eggert
(quotearg_buffer_restyled): Use bool for booleans.
2004-04-13Remove trailing blanks.Jim Meyering
2004-04-04Sync from gnulib.Jim Meyering
2003-10-31Update from gnulib.Jim Meyering
2002-11-23Include quotearg.h immediately after config.h.Jim Meyering
No need to include stddef.h or sys/types.h any more. Surround local include files with "", not "<>". Assume HAVE_LIMITS_H unconditionally, as we assume C89. Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX, HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS. (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC. (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT. (ISPRINT): Remove; no longer needed now that we assume C89. (clone_quoting_options, quotearg_buffer, quotearg_n_options): Preserve errno. (quotearg_buffer_restyled, quotearg_n, quotearg_n_style, quotearg_char): Use SIZE_MAX rather than (size_t) -1 when we are talking about "infinity". (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
2002-11-21Use `"'s when including quotearg.h and xalloc.h, not the `<...>' notation.Jim Meyering
Include <errno.h> and declare errno if necessary.
2002-11-21(quotearg_buffer_restyled): If mbrtowc returnsJim Meyering
`(size_t) -1' (at which point it would also set errno to EILSEQ), then restore errno to its previous value. Reported by Phillip Jones via Tim Waugh as https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=76334.
2002-01-22(quotearg_buffer_restyled):Jim Meyering
Fix bug with quoting buffers containing NUL when backslashing escapes. This bug was exposed by the other changes in this patch. (quotearg_n_options): New arg ARGSIZE. All callers changed. (quoting_options_from_style): New function. (quotearg_n_style): Use it. (quotearg_n_style_mem): New function.
2001-11-28(quotearg_n, quotearg_n_style): Likewise.Jim Meyering
(SIZE_MAX, UINT_MAX): New macros. (quotearg_n_options): Abort if N is negative. Avoid overflow check on hosts where size_t is 64 bits and int is 32 bits, as overflow is impossible there. Fix off-by-one typo that caused unnecessary reallocation.
2001-08-31BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared.Jim Meyering
2001-02-17(mbrtowc, mbsinit):Jim Meyering
Remove workaround macros for hosts that have mbrtowc but not mbstate_t, as we now insist on proper declarations for both before using mbrtowc.
2001-01-26Include stddef.h.Jim Meyering
2000-09-09Rename ISASCII to IN_CTYPE_DOMAIN.Jim Meyering
2000-07-31(quotearg_n_options): Don't make the initialJim Meyering
slot vector a constant, since it might get modified.
2000-07-31(quotearg_n_options): Preallocate a slot 0Jim Meyering
buffer, so that the caller can always quote one small component of a "memory exhausted" message in slot 0. From a suggestion by Jim Meyering.
2000-07-24Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),Jim Meyering
so that mbstate_t is always defined. Do not inspect MB_LEN_MAX, since it's incorrectly defined to be 1 in at least one GCC installation, and this configuration error is likely to be common. Ignoring MB_LEN_MAX hurts performance on hosts that have mbrtowc but have only unibyte locales, but I assume these hosts are rare.
2000-07-23Streamline by invoking multibyte code only if needed.Jim Meyering
<wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX. (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX). (quotearg_buffer_restyled): If a unibyte locale, don't bother to invoke multibyte primitives.
2000-07-23When the system forces us to redefine mbstate_t, shadow its mbsinit function.Jim Meyering
2000-07-14(mbrtowc): Do not use HAVE_WCHAR_H in the definition.Jim Meyering
Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT, to decide whether to define the BeOS workaround macro; this adjusts to the change to AC_MBSTATE_T.
2000-07-14(quoting_style_args, quoting_style_vals,Jim Meyering
quotearg_buffer_restyled): Add support for clocale_quoting_style. Undo previous change to locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}" and "{RIGHT QUOTATION MARK}" msgids.
2000-07-09The old behavior of quoting `like this' doesn't look good withJim Meyering
newer, ISO-style fonts. See: http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html Instead, quote "like this" by default. Let the translator tailor the locale-specific quoting behavior by providing translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}. (N_): New macro. (gettext_default): New function. (quotearg_buffer_restyled): Use gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
2000-07-06(mbrtowc): Declare returned type, since BeOS doesn't.Jim Meyering
2000-07-06(struct quoting_options): Simplify quote_these_too dimension.Jim Meyering
2000-07-04Make inclusion of <wchar.h> independent of whetherJim Meyering
HAVE_MBRTOWC is set. Required at least for irix-5.6, which lacks mbrtowc.
2000-07-04(mbrtowc): Assign to *pwc, and return 1 only if result is nonzero.Jim Meyering
(iswprint): Use ISPRINT when substituting our own mbrtowc.
2000-07-02(mbstate_t): Don't define here.Jim Meyering
2000-06-23Include <wctype.h> after <wchar.h>,Jim Meyering
for Solaris 2.5. (mbrtowc, mbstate_t): Define substitutes if HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT. (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT, not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
2000-02-28(ALERT_CHAR): New macro.Jim Meyering
(quotearg_buffer_restyled): Use it.
2000-01-31fix typo. sheeshJim Meyering
2000-01-31(ISASCII): Add #undef and move definition to followJim Meyering
inclusion of wctype.h to work around solaris2.6 namespace pollution. (ISPRINT): Likewise.
2000-01-22[HAVE_WCTYPE_H]: Include <wctype.h>.Jim Meyering
2000-01-17(quotearg_buffer_restyled): Do not quoteJim Meyering
alert, backslash, formfeed, and vertical tab unnecessarily in shell quoting style.
2000-01-15Quote multibyte characters correctly.Jim Meyering
(ISGRAPH): Remove. (ISPRINT): New macro. (<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H. (isprint, mbrtowc, mbsinit, mbstate_t): New macros, defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H). (quotearg_buffer_restyled): New function, with most of the old quotearg_buffer's contents. Major rewrite to support multibyte characters. (quotearg_buffer): Now just calls quotearg_buffer_restyled.
1999-08-10Include <libintl.h> if ENABLE_NLS.Jim Meyering
(_): New macro. (quoting_style_args, quoting_style_v, quotearg_buffer): Add support for locale_quoting_style, using _("`") and _("'") for open and close quote symbols. Do not quote spaces in escape_quoting_style. (quotearg_n_style, quotearg_style): New functions.
1999-08-01(quotearg_buffer):Jim Meyering
Don't quote spaces if C quoting style.
1999-01-25(quotearg_n_options): Revert type of parameter `n'Jim Meyering
(and hence that of the local `n1', too) to `int' at Paul's request.
1999-01-16(quotearg_n_options): Declare n1 to be of typeJim Meyering
unsigned int, not just int.
1999-01-11(quotearg_buffer): Change escape_quoting_style so that it no longer escapes ` '.Jim Meyering
Suggestion from Paul Eggert.
1999-01-01(quotearg_n_options): Make `options' parameter be `const'.Jim Meyering
1999-01-01(quotearg_buffer): Cast -1 to size_t before comparing.Jim Meyering
(quotearg_n): Change type of 1st parameter from int to unsigned int. (quotearg_n_options): Likewise. From Akim Demaille.
1998-12-11(quotearg_buffer): Use `7' as the mask, not `3'.Jim Meyering
From Bruno Haible.
1998-03-21Update from patch-2.5.3.Jim Meyering
1998-02-23.Jim Meyering