Age | Commit message (Collapse) | Author |
|
* src/seq.c (print_numbers): Also handle first < last && step < 0.
* tests/misc/seq [empty-rev]: New test for this case.
|
|
* NEWS: Say this.
* src/seq.c (print_numbers): Handle another floating point corner case.
This avoids failure of seq's eq-wid-7 test on FreeBSD 6.1.
|
|
* NEWS: Mention the %%-in-format bug fix.
* src/seq.c (struct layout): New type.
(long_double_format): New arg LAYOUT. Fill it in. Fix mishandling
of %% in formats.
(print_numbers): New arg LAYOUT. Don't convert LAST to output format
when deciding whether to go slightly past LAST. Instead, convert
X to output format and back. This fixes a bug reported by
Andreas Schwab in
<http://lists.gnu.org/archive/html/bug-coreutils/2007-10/msg00237.html>
where "seq 10.8 0.1 10.95" would output 11.0 on platforms where
10.95 rounds to a value that prints as 11.0 when only one digit
past the decimal point is asked for.
(main): Compute layout, for benefit of print_numbers.
* tests/misc/seq (float-3): Undo previous change, since the bug
should be fixed now.
(fmt-b): New test, for the %% bug.
|
|
|
|
|
|
* src/seq.c: Fix the -w logic. Ignore spaces and '+'
characters of input numbers when determining width.
Set format correctly for input numbers in scientific notation.
* tests/seq/basic: Add various number width tests.
Details: <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10903>
Signed-off-by: Pádraig Brady <Pádraig Brady P@draigBrady.com>
|
|
where it would not print the desired last number.
* doc/coreutils.texi (seq invocation): Remove advice about workaround
for seq off-by-one problem, since the bug is fixed now. Replace
it with more-generic advice about rounding errors.
* src/seq.c (long_double_format, print_numbers):
New arg NUMERIC_FORMAT. All uses changed.
|
|
* src/system.h (emit_bug_reporting_address): New function.
* src/base64.c: Use it rather than a literal printf.
* src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c:
* src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c:
* src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c:
* src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c:
* src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c:
* src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c:
* src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c:
* src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c:
* src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c:
* src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c:
* src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c:
* src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c:
* src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c:
* src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c:
* src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c:
* src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c:
* src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c:
* src/who.c, src/whoami.c, src/yes.c: Likewise.
|
|
I found.
* Makefile.maint (my-distcheck): Also check for C89 compatibility
as best we can with GCC.
* src/stat.c (PRINTF_OPTION): Omit comma before } in enum
declaration; C89 doesn't allow this.
* src/dcgen: Don't generate string literals longer than
what C89 requires support for.
* src/cut.c (usage): Don't use string literals longer than
what C89 requires support for.
* src/date.c (usage): Likewise.
* src/dd.c (usage): Likewise.
* src/du.c (usage): Likewise.
* src/ls.c (usage): Likewise.
* src/od.c (usage): Likewise.
* src/readlink.c (usage): Likewise.
* src/seq.c (usage): Likewise.
* src/shred.c (usage): Likewise.
|
|
(isfinite) [!defined isfinite]: New macro.
(separator, terminator): Now points to const.
(first, step, last): Remove.
(usage): Update to match new behavior.
(struct operand, operand): New type.
(scan_arg): Renamed from scan_double_arg, since we no longer use double.
All uses changed.
Compute and return a value of type operand, not double.
(long_double_format): Renamed from valid_format, and now returns a
new format with an "L" added if needed, if the original format was
valid. Allow %a, %A, %E, %F, and %G formats.
(print_numbers): Take numeric values as args rather than from globals.
Print long double, not double.
(get_width_format): Remove.
(get_default_format): New function.
(main): Implement new way of calculating default format.
Don't worry about locale's representation of the decimal point, since
the arguments are always processed in the C locale.
|
|
Rather than this: error (..., "...`%s'...", arg);
do this: error (..., "...%s...", quote (arg));
|
|
|
|
|
|
Add `void' to make this an ANSI-style function declaration.
|
|
All uses changed.
|
|
|
|
|
|
too few operands ("missing operand after `xxx'") or
too many operands ("extra operand `xxx'").
Include "quote.h" and/or "error.h" if it wasn't already being included.
|
|
|
|
'int', to avoid problems with integer overflow. On almost all
machines 'double' works in every case where 'int' works, and
it works on other cases besides.
|
|
|
|
(print_numbers): Now returns void, not (zero) int.
All callers changed.
(main): Remove unused local variable 'errs'. Always exit successfully
if we reach the end.
|
|
(scan_double_arg): Update xstrtod call to include new argument, c_strtod.
|
|
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.
|
|
Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
Mark each WRITTEN_BY string as translatable.
|
|
(print_numbers): Allow the output to be empty.
(main): The default step is 1, even if LAST < FIRST;
as per documentation.
|
|
endpoint requiring the largest width is negative and smaller than
the other endpoint.
(get_width_format): Include `-' in the set of bytes
allowed in a `simple' number (no decimal point, no exponent).
|
|
Don't include closeout.h.
|
|
|
|
format flag characters.
Do not require that a field width be specified.
Do not fail when given a field width of `0'.
|
|
`exit (1)' to `exit (EXIT_FAILURE)', and
`usage (1)' to `usage (EXIT_FAILURE)'.
|
|
|
|
a *floating-point* format, also in description of that option.
(usage): Also add the `=' signs here: --format=FORMAT,
--separator=STRING.
|
|
instead of hard-coding --help and --version descriptions.
Split --help output into smaller pieces.
Use fputs, not printf.
|
|
|
|
(main): Call atexit with close_stdout.
|
|
(main): Call close_stdout.
|
|
remove unnecessary uses of `defined' (aesthetics).
|
|
|
|
[Instead, merely give examples showing how to accomplish the same
task with fewer limitations using existing tools. ]
Suggestion from Bruno Haible.
(valid_format): Rename from check_format.
|
|
|
|
(format_type): New global to take place of intconv.
(DO_printf): New macro.
(main): Use it.
|
|
(intconv): New variable.
(usage): Update.
(main): Call scan_arg instead of scan_double_arg. Call check_format
before scan_arg.
(scan_int_arg, scan_arg): New functions.
(check_format): Add intconv argument. Accept %d, %u, %o, %x, %X.
(print_numbers): If intconv is true, pass an int argument to printf.
|
|
Instead, loop on `optind < argc' to protect use of argv[optind].
|
|
|
|
|
|
commands like `seq 10 -2 0' wouldn't work. From Andreas Schwab.
|
|
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
|
|
|
|
[long_options]: Remove the "help" and "version" entries.
Remove declarations of show_help and show_version.
(main): Use parse_long_options, including author name(s).
Remove the show_version and show_help blocks.
|