1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 21:47:46 +00:00

tac: support multi-char separator with overlap

Fix a bug in `tac` where multi-character line separators would cause
incorrect behavior when there was overlap between candidate matches in
the input string. This commit adds a dependency on `memchr` in order to
use the `memchr::memmem::rfind_iter()` function to scan for
non-overlapping instances of the specified line separator characters,
scanning from right to left.

Fixes #2580.
This commit is contained in:
Jeffrey Finkelstein 2021-08-22 16:21:08 -04:00
parent c77115ab51
commit 0e689e78aa
4 changed files with 107 additions and 22 deletions

1
Cargo.lock generated
View file

@ -2937,6 +2937,7 @@ name = "uu_tac"
version = "0.0.7"
dependencies = [
"clap",
"memchr 2.4.0",
"uucore",
"uucore_procs",
]