Age | Commit message (Collapse) | Author |
|
to pacify gcc -Wswitch-default.
|
|
|
|
order to avoid an unsuppressible warning from gcc on 64-bit systems.
|
|
|
|
|
|
(quotearg_buffer_restyled): Use bool for booleans.
|
|
|
|
|
|
|
|
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.
|
|
Include <errno.h> and declare errno if necessary.
|
|
`(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.
|
|
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.
|
|
(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.
|
|
|
|
Remove workaround macros for hosts that have mbrtowc but not
mbstate_t, as we now insist on proper declarations for both
before using mbrtowc.
|
|
|
|
|
|
slot vector a constant, since it might get modified.
|
|
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.
|
|
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.
|
|
<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.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
|
|
HAVE_MBRTOWC is set. Required at least for irix-5.6, which lacks mbrtowc.
|
|
(iswprint): Use ISPRINT when substituting our own mbrtowc.
|
|
|
|
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).
|
|
(quotearg_buffer_restyled): Use it.
|
|
|
|
inclusion of wctype.h to work around solaris2.6 namespace pollution.
(ISPRINT): Likewise.
|
|
|
|
alert, backslash, formfeed, and vertical tab unnecessarily in
shell quoting style.
|
|
(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.
|
|
(_): 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.
|
|
Don't quote spaces if C quoting style.
|
|
(and hence that of the local `n1', too) to `int' at Paul's request.
|
|
unsigned int, not just int.
|
|
Suggestion from Paul Eggert.
|
|
|
|
(quotearg_n): Change type of 1st parameter from int to unsigned int.
(quotearg_n_options): Likewise.
From Akim Demaille.
|
|
From Bruno Haible.
|
|
|
|
|