summaryrefslogtreecommitdiff
path: root/gnulib
diff options
context:
space:
mode:
authorDylan Cali <calid1984@gmail.com>2014-09-05 04:42:02 -0500
committerPádraig Brady <P@draigBrady.com>2015-06-19 19:59:21 +0100
commit71063bc858cd927e3622b511297e66b3e13f7453 (patch)
treef7574dc51bb55b27881a2d063fb37c76198a4be4 /gnulib
parent5863426dcfec2336cf0e1a28255e9080889fcb4c (diff)
downloadcoreutils-71063bc858cd927e3622b511297e66b3e13f7453.tar.xz
numfmt: implement support for field ranges
* src/numfmt.c: Replace field handling code with logic that understands field range specifiers. Instead of processing a single field and printing line prefix/suffix around it, process each field in the line checking whether it has been included for conversion. If so convert and print, otherwise just print the unaltered field. (extract_fields): Removed. (skip_fields): Removed. (process_line): Gutted and heavily reworked. (process_suffixed_number): FIELD is now passed as an arg instead of using a global. (parse_field_arg): New function that parses field range specifiers. (next_field): New function that returns pointers to the next field in a line. (process_field): New function that wraps the field conversion logic (include_field): New function that checks whether a field should be converted (compare_field): New function used for field value comparisons in a gl_list. (free_field): New function used for freeing field values in a gl_list. Global variable FIELD removed. New global variable all_fields indicates whether all fields should be processed. New global variable all_fields_after stores the first field of a N- style range. New global variable all_fields_before stores the last field of a -M style range. New global variable field_list stores explicitly specified fields to process (N N,M or N-M style specifiers). (usage): Document newly supported field range specifiers. * bootstrap.conf: Include xlist and linked-list modules. numfmt now uses the gl_linked_list implementation to store the field ranges. * tests/misc/numfmt.pl: Add tests for 'cut style' field ranges. Adjust existing tests as partial output can occur before an error Remove test for the 'invalid' field -5.. this is now a valid range. * gnulib: update to avoid compiler warnings in linked-list. * NEWS: Mention the new feature.
Diffstat (limited to 'gnulib')
m---------gnulib0
1 files changed, 0 insertions, 0 deletions
diff --git a/gnulib b/gnulib
-Subproject 9a417cf7d48fa231c937c53626da6c45d09e6b3
+Subproject d0302f003873b8c633d2023ab98aa6c4045b32e