Commit Graph
16 Commits
Author SHA1 Message Date
Jim Meyering da9f5e7fdf join bug fix: adapt keycmp to work with new order-checking feature
* src/join.c (keycmp): Add two join-field parameters.
(check_order, join): Update callers.
Reported by Dmitry V. Levin in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12731/focus=13017
* tests/join/Test.pm (chkodr-7): New test for this fix.
2008-03-25 19:10:10 +01:00
James Youngman a1e715698a join: new options: --check-order and --nocheck-order.
* src/join.c: Support --check-order and --nocheck-order.
New variables check_input_order, seen_unpairable and
issued_disorder_warning[]. For --check-order, verify that the
input files are in sorted order.  For the default case, check the
order only if there are unpairable lines.
(join): Perform ordering checks after reaching EOF on either
input.
(usage): Mention --check-order and --nocheck-order.
(dupline): Save a copy of the previously-read input line so that
we can detect disorder on the input.
(get_line): Temporarily save a copy of the previous line (by
calling dupline) and check relative ordering (by calling
checkorder) before returning the newly-read line.
(getseq, join): Tell get_line which file we are reading from.
(advance_seq): New function, factoring out some of the code
commonly surrounding calls to getseq.
(checkorder): New function.  Verifies that a pair of consecutive
input lines are in sorted order.
* doc/coreutils.texi (join invocation): Document the new options
--check-order and --nocheck-order.
* tests/join/Test.pm (tv): Added tests for --check-order and
--nocheck-order.
* NEWS: Mention this new feature.
2008-02-19 15:17:39 +01:00
Jim Meyering 71aa3ea880 Update all copyright notices to use the newer form. 2007-07-23 14:35:58 +02:00
Jim Meyering 33342c1a0a Change "version 2" to "version 3" in all copyright notices. 2007-07-10 13:35:56 +02:00
Paul Eggert ec95137cc3 Remove some arbitrary restrictions on size fields,
so that commands like "sort -k 18446744073709551616" no longer fail merely
because 18446744073709551616 doesn't fit in uintmax_t.  The trick is that
these fields can all be treated as effectively infinity;  their exact
values don't matter, since no internal buffer can be that long.
* src/join.c (string_to_join_field): Verify that SIZE_MAX <= ULONG_MAX
if the code assumes this.  Silently truncate too-large values to SIZE_MAX,
as the remaining code will do the right thing in this case.
* src/sort.c (parse_field_count): Likewise.
* src/uniq.c (size_opt, main): Likewise.
* tests/join/Test.pm (bigfield): New test.
* tests/sort/Test.pm (bigfield): New test.
* tests/uniq/Test.pm (121): New test.
Signed-off-by: Jim Meyering <jim@meyering.net>
2006-12-13 22:03:54 +01:00
Paul Eggert 218fa5c61b Add/fix copyright notices and adjust to latest GNU FDL. 2006-08-17 19:58:17 +00:00
Jim Meyering 1b9d200986 (invalid-j): New partial test for the above fix. 2004-03-10 17:39:34 +00:00
Jim Meyering 1276aa43f3 (tv): Avoid obsolete -o usage. 2003-12-30 08:49:53 +00:00
Jim Meyering b77cb25935 (8-bit-t): New test for the above fix. 2000-11-16 14:19:00 +00:00
Jim Meyering dd7e9b194e *** empty log message *** 1999-07-10 07:34:52 +00:00
Jim Meyering bfbd79ca59 New test case for Paul's 1999-06-03 fix. 1999-07-04 09:46:07 +00:00
Jim Meyering 1acf1ddd65 (trailing-sp): New test for this fix. 1999-05-15 05:28:51 +00:00
Jim Meyering 1b47ed2714 Use test_vector, not array @t. 1996-12-22 14:09:10 +00:00
Jim Meyering b3335ab809 remove $nl. 1996-12-20 05:35:26 +00:00
Jim Meyering d293e5f03c Adapted for new mk-script.pl. 1996-12-20 05:35:01 +00:00
Jim Meyering 97f0f916a2 . 1996-10-18 04:55:16 +00:00