summaryrefslogtreecommitdiff
path: root/src/printf.c
AgeCommit message (Collapse)Author
2006-08-23* NEWS: printf supports the I flag.Paul Eggert
* src/printf.c (print_formatted) [glibc 2.2 or later]: Likewise.
2006-08-21Add a bootstrap procedure, so that the CVS version contains fewerPaul Eggert
files and we bootstrap the rest from gnulib, gettext, etc. * README-cvs: New file. * bootstrap: New file. * bootstrap.conf: New file. * .x-sc_trailing_blank: Remove config-log, .gdb-history. Add .po. * configure.ac (AC_PREREQ): Move here from m4/*.m4, for benefit of gnulib-tool. (gl_DEFAULT_POSIX2_VERSION, gl_USE_SYSTEM_EXTENSIONS, gl_PERL): (gl_IGNORE_UNUSED_LIBRARIES): Remove; now done by gnulib. (gl_EARLY): Add. (gl_MACROS): Call just after gl_EARLY, just for clarity. * src/c99-to-c98.diff: Remove patch to ls.c; no longer needed. * src/kill.c (strtoimax): Remove decl. * src/ls.c: Include "wcwidth.h" instead of rolling it ourselves. * src/wc.c: Likewise. * src/ls.c (sort_files): Rewrite to avoid need for C99-style declaration, so that we don't need to patch this file. * src/printf.c (strtoimax, strtoumax): Remove decls. * src/su.c: Include getpass.h. (getpass): remove. * src/system.h: Include mempcpy.h, stpcpy.h, strpbrk.h. Include inttypes.h unconditionally; remove decls it handles. * lib/Makefile.am: include gnulib.mk, so that we can remove most of this file. (AM_CPPFLAGS): Don't mention -I$(srcdir), since that's now done for us. (noinst_LIBRARIES, LDDADD, DEFS): Remove. (libcoreutils_a_SOURCES): Trim down greatly, just to the files that aren't in gnulib. Remove defns gnulib does for us. * m4/check-decl.m4 (gl_CHECK_DECLS): Don't include stdio.h, string.h, stdlib.h, unistd.h, sys/time.h, time.h. Use AC_CHECK_DECLS_ONCE for free, getenv, geteuid, getlogin, getuid, lseek, malloc, memchr, realloc. Don't check for getutent, memrchr, nanosleep, stpcpy, strndup, strnlen, strstr, strtoul, strtoull. (_gl_DECL_HEADERS): Remove; all uses removed. * m4/jm-macros.m4 (gl_MACROS): Move AC_PREREQ into configure.ac for the benefit of gnulib-tool. Call gl_INIT. Do not call or require macros that gnulib will handle for us. Don't check for fchmod, hasmntopt, isascii, lchown, listmntent, mempcpy, realpath, wcrtomb, tzset. (gl_CHECK_ALL_HEADERS): Don't check for sys/statvfs.h, sys/vfs.h, sys/mount.h. (gl_CHECK_ALL_TYPES): Require AC_TYPE_UNSIGNED_LONG_LONG_INT. Don't check for struct stat.st_blksize. Don't require AC_STRUCT_ST_DM_MODE, gt_TYPE_SSIZE_T, gl_AC_TYPE_UINT32_T, gl_AC_TYPE_UINTMAX_T, gl_AC_TYPE_UINTPTR_T, gl_AC_TYPE_UNSIGNED_LONG_LONG. * m4/prereq.m4 (gl_PREREQ): Require gl_FUNC_XFTS, gl_ROOT_DEV_INO. Don't require macros that gnulib does for us. * m4/stat-prog.m4 (cu_PREREQ_STAT_PROG): Don't check for sys/sysmacros.h. Don't check for statvfs. Use AC_CHECK_HEADERS_ONCE for netinet/in.h, nfs/nfs_clnt.h, nfs/vfs.h. Don't require gl_AC_TYPE_LONG_LONG, gt_HEADER_INTTYPES_H.
2006-07-09(print_esc): Don't assume char is unsigned.Paul Eggert
2005-07-03(verify_numeric): Rename from verify.Jim Meyering
Update caller.
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