summaryrefslogtreecommitdiff
path: root/src/printf.c
AgeCommit message (Collapse)Author
2005-06-16Don't embed `this'-style quotes in format strings.Jim Meyering
Include "quote.h". Rather than this: error (..., "...`%s'...", arg); do this: error (..., "...%s...", quote (arg));
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-14Update FSF postal mail address.Jim Meyering
2005-04-04(usage): Move USAGE_BUILTIN_WARNING to end of --help output.Jim Meyering
2005-04-04(usage): Mention that some shells provide a built-inJim Meyering
function by the same name.
2005-03-06Remove register keyword.Jim Meyering
2004-10-15(usage): Mention Unicode, and use H for hex digits.Paul Eggert
2004-08-03(posixly_correct): Use bool for booleans.Paul Eggert
(verify, main): Use EXIT_FAILURE/EXIT_SUCCESS instead of 1/0. (STRTOX): Rewrite to avoid casts. (print_esc_char): Arg is char, not int.
2004-07-28(strtiomax, strtoumax): Declare if not alreadyPaul Eggert
declared: this fixes a portability bug with Solaris 8 + GCC. (STRTOX): Parenthesize use of macro arg as expression. (vstrtoimax, vstrtoumax, vstrtold): Remove now-unnecessary parentheses.
2004-07-12(vstrtold): Renamed from vstrtod.Paul Eggert
Now returns long double. All uses changed. (print_direc): Use "L" length modifier when printing floating point numbers, since we're now printing long double.
2004-07-08printf cleanup, to avoid undefined behavior, to add support forJim Meyering
formats that Bash supports, and to support wide integers like Bash does. (UNSPECIFIED): Remove. All uses now replaced by booleans, so that we don't reserve any values for precision or width (like Bash). (STRTOX): Use prototype, not K&R-style definition. (vstrtoimax): Renamed from xstrtol (to avoid confusion with xstrtol in ../lib), with type change to intmax_t. All uses changed. (vstrtoumax): Renamed from xstrtoul, with type change to uintmax_t. All uses changed. (vstrtod): Renamed from xstrtod. All uses changed. (print_direc): Use boolean arg instead of special value to indicate a missing precision or width. LENGTH no longer includes length modifiers or conversion character. New arg CONVERSION now specifies conversion character. Use intmax_t-width formatting for integers (like Bash). Add support for C99 %a, %A, %F (like Bash). Add support for field width with %c (POSIX requires this). Add a FIXME for lack of support for field width and precision for %b. Add support for '\'', '0' flags. Check for invalid combinations of flags, field width, precision, and conversion, to prevent use of undefined behavior. Allow multiple length modifiers, for formats like "%lld" (like Bash). Add support for C99 'j', 't', 'z' length modifiers (like Bash). In error message, output entire invalid conversion specification, instead of merely outputting % followed by the conversion char.
2004-06-26(main): When given no arguments, print the standardJim Meyering
"missing operand\nTry printf --help..." message -- to be consistent.
2004-06-15(print_esc): Support \x, \u, \U even if POSIXLY_CORRECT,Jim Meyering
since POSIX says the behavior is unspecified here. (main): Recognize --help, --version even if POSIXLY_CORRECT. POSIX does not specify any options, but it does not prohibit options either, so "printf" is like "expr" here.
2004-05-13(print_esc_char): Use e.g. '\a' rather than '\007',Jim Meyering
for portability to EBCDIC hosts.
2004-01-21(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
2003-11-27Remove decls of strtod, strtol, strtoul; no longerJim Meyering
needed now that we assume C89. Include "c-strtod.h". (xstrtod): Call c_strtod, not strtod.
2003-11-05Cast NULL to `(char *)' in call to variadic function,Jim Meyering
parse_long_options, so that it works even on systems for which sizeof char* != sizeof int.
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings. Update the call to parse_long_options so that `AUTHORS, NULL' are the last parameters. * src/true.c (main): Append NULL to version_etc argument list. * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-09-18revert previous changeJim Meyering
2003-09-18Update AUTHORS definition to be a comma-separated list of strings and/or updateJim Meyering
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include closeout.h.
2003-06-17(main): Call initialize_main.Jim Meyering
2003-05-10(main): Handle argc == 0.Jim Meyering
2003-04-21(print_esc): Tweak spelling of new variable.Jim Meyering
2003-04-21Fix printf POSIX compatibility bug reported by Ben Harris inJim Meyering
<http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>. * doc/coreutils.texi (printf invocation): It's \NNN in the format, \0NNN in the %b operand. * src/printf.c (usage): Likewise. (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN is desired. All uses changed. Behave like Bash printf if %b operand uses \NNN where the initial N is not 0.
2003-03-27Fix buffer overrun problem reported by TAKAI Kousuke, alongJim Meyering
with some other POSIX incompatibilities. (print_esc): Do not treat \x specially if POSIXLY_CORRECT. Avoid buffer overrun if the format ends in backslash. Treat incomplete escape sequences as strings of characters, as POSIX requires. (print_formatted): Allow multiple flags. Avoid buffer overrun if the format is incomplete.
2003-03-11Don't segfault for a negative field width or precision in format string.Jim Meyering
(UNSPECIFIED): Define. (print_direc): Use the special value, UNSPECIFIED, to indicate that field_width or precision has not been specified. (print_formatted): Fail if field_width or precision is the special value, UNSPECIFIED.
2003-03-05(print_esc): Remove pointless comparison of unsignedJim Meyering
integer with zero, to avoid a warning from Intel's ecc.
2002-11-06(usage): Update description.Jim Meyering
2002-11-06(print_esc): Hexadecimal \xhh escapes may haveJim Meyering
at most two hex. digits, not three.
2002-09-13(main): Handle leading command line argument of `--'.Jim Meyering
2002-08-31Change `exit (0)' to `exit (EXIT_SUCCESS)',Jim Meyering
`exit (1)' to `exit (EXIT_FAILURE)', and `usage (1)' to `usage (EXIT_FAILURE)'.
2002-08-30Change `error (1, ...' to `error (EXIT_FAILURE, ...'.Jim Meyering
2002-07-02(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.Jim Meyering
2002-02-11From Bruno HaibleJim Meyering
(print_esc): Call print_unicode_char with exit_on_error = false.
2001-12-15Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTIONJim Meyering
instead of hard-coding --help and --version descriptions. Split --help output into smaller pieces. Use fputs, not printf.
2001-11-25(usage): Indent --help and --version strings to start in the 7th column.Jim Meyering
2001-09-17(main): Change the `ignoring excess arguments' diagnosticJim Meyering
to list the first one we're ignoring. Suggestion from Karl Berry.
2001-08-07(cfcc_msg): Remove now-inaccurate part of comment.Jim Meyering
From Bruno Haible.
2000-05-07Include "closeout.h".Jim Meyering
(main): Call atexit with close_stdout.
2000-05-05Exit nonzero upon write failure.Jim Meyering
Include "closeout.h". (main): Call close_stdout. Reported by Ian Jackson via Michael Stone.
2000-03-04Include "unicodeio.h".Jim Meyering
(usage): Mention \u and \U directives. \x outputs a byte, not a character. (print_esc): Implement \u and \U.
1999-04-06split long lineJim Meyering
1999-03-31(PROGRAM_NAME, AUTHORS): Define and use.Jim Meyering
1999-03-04(main): Include author name argument in call to parse_long_options.Jim Meyering
1999-02-16update copyright datesJim Meyering
1999-01-25(usage): Remove static attribute.Jim Meyering
1998-09-19update bug-reporting addressJim Meyering
1998-06-29revert back to using lower case _unlocked wrapper namesJim Meyering