summaryrefslogtreecommitdiff
path: root/cfg.mk
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2014-05-30 17:44:32 +0100
committerPádraig Brady <P@draigBrady.com>2014-06-01 12:14:39 +0100
commit5c6cf94ba5f6c05b3ab6e732de7202754558c03c (patch)
treec042e76c151a9ee32b26ae88ce68637bb48c9c03 /cfg.mk
parent39d1c9576a3f2e5e65c5fb06744aa7245d743bc0 (diff)
downloadcoreutils-5c6cf94ba5f6c05b3ab6e732de7202754558c03c.tar.xz
cut: restore special case handling of -f with -d$'\n'
commits v8.20-98-g51ce0bf and v8.20-99-gd302aed changed cut(1) to process each line independently and thus promptly output each line without buffering. As part of those changes we removed the special handling of --delimiter=$'\n' --fields=... which could be used to select arbitrary (ranges of) lines, so as to simplify and optimize the implementation while also matching the behavior of different cut(1) implementations. However that GNU behavior was in place for a long time, and could be useful in certain cases like making a separated list like `seq 10 | cut -f1- -d$'\n' --output-delimiter=,` although other tools like head(1) and paste(1) are more suited to this operation. This patch reinstates that functionality but restricts the "line behind" buffering behavior to only the -d$'\n' case. We also fix the following related edge case to be more consistent: before> printf "\n" | cut -s -d$'\n' -f1- | wc -l 2 before> printf "\n" | cut -d$'\n' -f1- | wc -l 1 after > printf "\n" | cut -s -d$'\n' -f1- | wc -l 1 after > printf "\n" | cut -d$'\n' -f1- | wc -l 1 * src/cut.c (cut_fields): Adjust as discussed above. * tests/misc/cut.pl: Likewise. * NEWS: Mention the change in behavior both for v8.21 and this effective revert. * cfg.mk (old_NEWS_hash): Adjust for originally omitted v8.21 entry. * src/paste.c: s/delimeter/delimiter/ comment typo fix.
Diffstat (limited to 'cfg.mk')
-rw-r--r--cfg.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/cfg.mk b/cfg.mk
index 1e884cde3..ea5fc99eb 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -45,7 +45,7 @@ export VERBOSE = yes
# 4914152 9e
export XZ_OPT = -8e
-old_NEWS_hash = 68fc9b352e924d5e59e2f543f80f6a41
+old_NEWS_hash = adf13e9314300d0dff82fa37b247d7db
# Add an exemption for sc_makefile_at_at_check.
_makefile_at_at_check_exceptions = ' && !/^cu_install_program =/'