summaryrefslogtreecommitdiff
path: root/src/seq.c
AgeCommit message (Collapse)Author
2007-07-09Fix the automatic number width formatting in seq.P@draigBrady.com
* 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>
2007-06-23seq no longer mishandles cases like "seq 0 0.000001 0.000003",Paul Eggert
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.
2007-03-28Help translators include translation team's web or email address.Jim Meyering
* 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.
2006-11-27Improve the check for departures from C89, and fix the departuresPaul Eggert
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.
2006-07-01Don't include <math.h> or <xstrtol.h>; no longer needed.Paul Eggert
(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.
2005-06-16Don't embed `this'-style quotes in format strings.Jim Meyering
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-03-28(get_width_format) [HAVE_RINT && HAVE_MODF && HAVE_FLOOR]:Jim Meyering
Add `void' to make this an ANSI-style function declaration.
2004-12-02(decimal_point): Treat like sort. Now char.Paul Eggert
All uses changed.
2004-09-21Remove unused "case 0".Paul Eggert
2004-08-02(equal_width, valid_format, main): Use bool for booleans.Paul Eggert
2004-06-21(main): Standardize on the diagnostics given when someone givesJim Meyering
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.
2004-02-23(usage): Remove stray space after \n in --help output.Jim Meyering
2004-02-03(print_numbers): Use 'double' for loop index, notJim Meyering
'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.
2004-01-27Reword so as not to exclude the possibility that INCREMENT be zero.Jim Meyering
2004-01-22(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
(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.
2003-11-27Include "c-strtod.h".Jim Meyering
(scan_double_arg): Update xstrtod call to include new argument, c_strtod.
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-05(step): Default to 1.Jim Meyering
(print_numbers): Allow the output to be empty. (main): The default step is 1, even if LAST < FIRST; as per documentation.
2003-09-04This makes seq's --width (-w) option work properly even when theJim Meyering
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).
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-03-20(valid_format): Also accept ` ' and `'' as validJim Meyering
format flag characters. Do not require that a field width be specified. Do not fail when given a field width of `0'.
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-07-02(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.Jim Meyering
2002-03-17(usage): Mention that --format=FORMAT must beJim Meyering
a *floating-point* format, also in description of that option. (usage): Also add the `=' signs here: --format=FORMAT, --separator=STRING.
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.
2000-12-02(valid_format): Move pre-increment to a separate statement to avoid a warning.Jim Meyering
2000-05-07Include "closeout.h".Jim Meyering
(main): Call atexit with close_stdout.
2000-05-05Include "closeout.h".Jim Meyering
(main): Call close_stdout.
2000-04-14Shorten `#ifdef HAVE_...' to `#if HAVE_...' andJim Meyering
remove unnecessary uses of `defined' (aesthetics).
2000-03-01(get_width_format): Fix portability problem with `-0' vs. `0'.Jim Meyering
2000-01-29Back out most of the 2000-01-21 and 01-22 changes.Jim Meyering
[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.
2000-01-22Topologically sort the functions and remove fwd declarations.Jim Meyering
2000-01-22(enum Format_type): Declare.Jim Meyering
(format_type): New global to take place of intconv. (DO_printf): New macro. (main): Use it.
2000-01-22Add support for octal and hexadecimal output.Jim Meyering
(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.
1999-04-26(main): Revert last change.Jim Meyering
Instead, loop on `optind < argc' to protect use of argv[optind].
1999-04-26revert last changeJim Meyering
1999-04-26(main): Handle the case in which seq is given no args.Jim Meyering
1999-04-19(main): Restore `+' in getopt_long string. Otherwise,Jim Meyering
commands like `seq 10 -2 0' wouldn't work. From Andreas Schwab.
1999-03-31No longer include long-options.h.Jim Meyering
[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.
1999-03-31(PROGRAM_NAME, AUTHORS): Define and use.Jim Meyering
1999-03-06Include long-options.h.Jim Meyering
[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.
1999-02-16update copyright datesJim Meyering
1999-01-25(usage): Remove static attribute.Jim Meyering
1998-09-28(main): Decrement optind when we find an `option' thatJim Meyering
looks like -N. Reported by Clark Morgan.
1998-09-19update bug-reporting addressJim Meyering
1998-07-15(check_format): Add `5' to the list of digits.Jim Meyering
Reported by Donni Erpel.