]> git.ipfire.org Git - thirdparty/coreutils.git/commit
Begin to address this comment: What if someone wants to
authorJim Meyering <jim@meyering.net>
Tue, 22 Jul 2003 11:56:24 +0000 (11:56 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 22 Jul 2003 11:56:24 +0000 (11:56 +0000)
commitbf2cf0b7ba5f2fb4b0685259efb16f4c127f2f43
treed2d4215576c9d428ab34046d8c4b1cbb17ca0203
parenta5eacea399ef5d2d83b3d629952866a1adabb3e7
Begin to address this comment: What if someone wants to
extract the 1,000,000-th field of some huge input file?
The first step is to rearrange things so that the values
in the printable_field array are all 0/1 rather than 0/1/2.

(RANGE_START_SENTINEL): Remove.
Store range-start indices in a hash table, rather than
overloading the `printable_field' array.
(range_start_ht): New global.
(hash_int, hash_compare_ints, is_range_start_index): New functions.
(print_kth): Use is_range_start_index; don't test printable_field.
(set_fields): Detect overflow.
(set_fields): Insert each range-start index into range_start_ht.
(main): Call set_fields only once, and only after
output_delimiter_specified and (if required) range_start_ht have
been defined.
src/cut.c