]> git.ipfire.org Git - thirdparty/coreutils.git/commit
diagnose too-large numbers better
authorPádraig Brady <P@draigBrady.com>
Tue, 16 Dec 2014 12:36:39 +0000 (12:36 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 19 Dec 2014 11:56:20 +0000 (11:56 +0000)
commit6894816c653adef54f3a85becbf75a865d6d39d6
tree82bb3126d3c8cfaeebc950bd03a52a4f5e0f056c
parent178f8e79dcd1e0b8bbb3b04da664d05eaae56186
diagnose too-large numbers better

Following on from commit v8.23-82-gaddae94, consistently diagnose
numbers that are too large, so as to distinguish from other errors,
and make the limits obvious.

* gl/modules/xdectoint: A new module implementing xdecto[iu]max(),
which handles the common case of parsing a bounded integer and
exiting with a diagnostic on error.
* gl/lib/xdectoimax.c: The signed variant.
* gl/lib/xdectoint.c: The parameterized implementation.
* gl/lib/xdectoint.h: The interface.
* gl/lib/xdectoumax.c: The unsigned variant.
* bootstrap.conf: Reference the new module.
* cfg.mk (exclude_file_name_regexp--sc_require_config_h_first):
Exclude the parameterized templates.
* src/csplit.c: Output EOVERFLOW or ERANGE errors if appropriate.
* src/fmt.c: Likewise.
* src/fold.c: Likewise.
* src/head.c: Likewise.
* src/ls.c: Likewise.
* src/nl.c: Likewise.
* src/nproc.c: Likewise.
* src/shred.c: Likewise.
* src/shuf.c: Likewise.
* src/stdbuf.c: Likewise.
* src/stty.c: Likewise.
* src/tail.c: Likewise.
* src/truncate.c: Likewise.
* src/split.c: Likewise.
* src/pr.c: Likewise.
* tests/pr/pr-tests.pl: Adjust to avoid matching errno diagnostic.
* tests/fmt/base.pl: Likewise.
* tests/split/l-chunk.sh: Likewise.
* tests/misc/shred-negative.sh: Likewise.
* tests/misc/tail.pl: Likewise.  Also remove the redundant
existing ERR_SUBST from test err-6.
* tests/ls/hex-option.sh: Check HEX/OCT options.
* tests/misc/shred-size.sh: Likewise.
* tests/misc/stty-row-col.sh: Likewise.
31 files changed:
bootstrap.conf
cfg.mk
gl/lib/xdectoimax.c [new file with mode: 0644]
gl/lib/xdectoint.c [new file with mode: 0644]
gl/lib/xdectoint.h [new file with mode: 0644]
gl/lib/xdectoumax.c [new file with mode: 0644]
gl/modules/xdectoint [new file with mode: 0644]
src/csplit.c
src/dd.c
src/fmt.c
src/fold.c
src/head.c
src/ls.c
src/nl.c
src/nproc.c
src/pr.c
src/shred.c
src/shuf.c
src/split.c
src/stdbuf.c
src/stty.c
src/tail.c
src/truncate.c
tests/fmt/base.pl
tests/local.mk
tests/ls/hex-option.sh [moved from tests/misc/shred-negative.sh with 79% similarity]
tests/misc/shred-size.sh [new file with mode: 0755]
tests/misc/stty-row-col.sh
tests/misc/tail.pl
tests/pr/pr-tests.pl
tests/split/l-chunk.sh