Commit Graph

80 Commits

Author SHA1 Message Date
Jim Meyering 4f4e9aa8e1 Don't include headers already included by system.h:
Don't include closeout.h.
2003-07-23 07:29:54 +00:00
Jim Meyering 6bcd4b08ba (main): Call initialize_main. 2003-06-17 18:13:23 +00:00
Jim Meyering 9eb8322209 (main): Handle argc == 0. 2003-05-10 20:00:54 +00:00
Jim Meyering 4247ffb57c (print_esc): Tweak spelling of new variable. 2003-04-21 18:02:00 +00:00
Jim Meyering 4bcefa6248 Fix printf POSIX compatibility bug reported by Ben Harris in
<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-04-21 17:59:21 +00:00
Jim Meyering cb392d1022 Fix buffer overrun problem reported by TAKAI Kousuke, along
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-27 14:59:26 +00:00
Jim Meyering 257b85ca8e Don't segfault for a negative field width or precision in format string.
(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-11 20:25:18 +00:00
Jim Meyering 57bdc54b21 (print_esc): Remove pointless comparison of unsigned
integer with zero, to avoid a warning from Intel's ecc.
2003-03-05 17:44:08 +00:00
Jim Meyering 59507dd554 (usage): Update description. 2002-11-06 10:28:02 +00:00
Jim Meyering 0a5d4112ba (print_esc): Hexadecimal \xhh escapes may have
at most two hex. digits, not three.
2002-11-06 09:04:50 +00:00
Jim Meyering 5bd4fe2400 (main): Handle leading command line argument of `--'. 2002-09-13 09:50:23 +00:00
Jim Meyering 4006f4e672 Change exit (0)' to exit (EXIT_SUCCESS)',
`exit (1)' to `exit (EXIT_FAILURE)', and
`usage (1)' to `usage (EXIT_FAILURE)'.
2002-08-31 08:52:10 +00:00
Jim Meyering 7488703199 Change error (1, ...' to error (EXIT_FAILURE, ...'. 2002-08-30 23:04:53 +00:00
Jim Meyering 2ee11887cd (usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it. 2002-07-02 09:09:10 +00:00
Jim Meyering 821811d87f From Bruno Haible
(print_esc): Call print_unicode_char with exit_on_error = false.
2002-02-11 14:32:22 +00:00
Jim Meyering 2fae9e5d26 Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTION
instead of hard-coding --help and --version descriptions.
Split --help output into smaller pieces.
Use fputs, not printf.
2001-12-15 20:46:30 +00:00
Jim Meyering 9e1b4e382a (usage): Indent --help and --version strings to start in the 7th column. 2001-11-25 14:46:05 +00:00
Jim Meyering c3a2a9a1cf (main): Change the `ignoring excess arguments' diagnostic
to list the first one we're ignoring.  Suggestion from Karl Berry.
2001-09-17 10:11:27 +00:00
Jim Meyering 0d1d166269 (cfcc_msg): Remove now-inaccurate part of comment.
From Bruno Haible.
2001-08-07 13:45:26 +00:00
Jim Meyering 2d4fd1ab6e Include "closeout.h".
(main): Call atexit with close_stdout.
2000-05-07 14:57:24 +00:00
Jim Meyering 3684b16708 Exit nonzero upon write failure.
Include "closeout.h".
(main): Call close_stdout.
Reported by Ian Jackson via Michael Stone.
2000-05-05 21:41:29 +00:00
Jim Meyering 29d3ba4a7b Include "unicodeio.h".
(usage): Mention \u and \U directives. \x outputs a byte, not a
character.
(print_esc): Implement \u and \U.
2000-03-04 12:52:35 +00:00
Jim Meyering 1f8c95df83 split long line 1999-04-06 17:26:07 +00:00
Jim Meyering 39090114f0 (PROGRAM_NAME, AUTHORS): Define and use. 1999-03-31 04:11:35 +00:00
Jim Meyering ff743d5451 (main): Include author name argument in call to parse_long_options. 1999-03-04 14:02:14 +00:00
Jim Meyering df7b9c808b update copyright dates 1999-02-16 04:17:15 +00:00
Jim Meyering 276d118b10 (usage): Remove static attribute. 1999-01-25 14:33:38 +00:00
Jim Meyering 24a8bf2d3e update bug-reporting address 1998-09-19 17:32:35 +00:00
Jim Meyering f3c14cb59f revert back to using lower case _unlocked wrapper names 1998-06-29 16:24:01 +00:00
Jim Meyering c5eb9edf26 Change all uses of unlocked-wrapped functions to their upper case wrapper names. 1998-06-29 02:13:21 +00:00
Jim Meyering 3fdd4e6cd2 add copyright 1998-05-16 20:21:39 +00:00
Jim Meyering 42755ceb62 cast for losing Solaris 1998-05-16 20:21:06 +00:00
Jim Meyering b3ab88e970 Remove old-style xmalloc and xrealloc decls. 1997-10-25 22:03:20 +00:00
Jim Meyering 5db3c9bdb4 update bug-reporting address 1997-10-07 23:51:39 +00:00
Jim Meyering 566451e5be remove fixme 1997-07-13 23:37:57 +00:00
Jim Meyering 7a280a0fda (STRTOX): Convert function header in macro definition
to K&R-style.  Otherwise, ansi2knr would fail to convert the function
definitions to K&R for old style compilers.  From Kaveh Ghazi.
1997-07-02 16:07:44 +00:00
Jim Meyering 9fb965dfd8 Add comment for posixly_correct. 1997-06-12 11:47:34 +00:00
Jim Meyering 795d254715 (STRTOX): Don't fail because of extra character(s) following a
character constant.  Give the *warning* only if !POSIXLY_CORRECT.
1997-04-27 23:45:57 +00:00
Jim Meyering 9778fd673b (cfcc_msg): File-scope constant.
(STRTOX): Use new constant as error message format string in macro.
Suggestion from Andreas Schwab.
1997-04-27 23:33:49 +00:00
Jim Meyering ca70b66b72 (STRTOX): New macro to eliminate code duplication.
(xstrtod, xstrtol, xstrtoul): Remove functions.
Use the STRTOX instead.
1997-04-06 20:58:16 +00:00
Jim Meyering 3426e7ca7a Change most char* dcls to const char*. 1997-04-06 19:32:19 +00:00
Jim Meyering 39b444e420 Reorder functions to obviate forward decls. 1997-04-06 19:30:07 +00:00
Jim Meyering 7eb03c4372 update copyrights for 1997 1997-02-09 04:54:16 +00:00
Jim Meyering 899a90bfd9 bracket bug address with <> and append a period 1997-02-01 04:23:31 +00:00
Jim Meyering 38da840313 (main): Warn if excess arguments are ignored.
E.g., printf foo bar now ignores the single non-format argument, bar.
1996-11-23 02:34:31 +00:00
Jim Meyering 5582e6dad3 change bug-reporting address 1996-11-03 03:16:27 +00:00
Jim Meyering b8e689dc67 change bug-reporting address 1996-11-02 20:44:15 +00:00
Jim Meyering f04044ed86 (main): update --version output to conform to coding standard 1996-10-05 16:37:57 +00:00
Jim Meyering e9d17da073 (usage): Tell where to report bugs. 1996-09-02 15:52:45 +00:00
Jim Meyering 971c5b1379 (main): Don't recognize --help, --h, --he, --version, --v, etc.
if the POSIXLY_CORRECT environment variable is set.
1996-05-18 18:36:36 +00:00