From: Victor Engmark via GNU coreutils Bug Reports <bug-coreutils@gnu.org>
To: 67593@debbugs.gnu.org
Subject: bug#67593: `split --number=l/N` no longer splits evenly
Date: Sun, 03 Dec 2023 13:25:01 +1300 [thread overview]
Message-ID: <e965589eeb832a95c0d107345244e928f57f060d.camel@engmark.name> (raw)
Hi all
Commit fb6fc7f3ce6b0b70a5df7f605e71c4f8541e256b (part of v9.2)
introduced a regression in how `split --number=l/N` works.
Test script `tests/split/l-chunk2.sh`:
```
#!/bin/sh
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
printf 'first\n' > exp1 || framework_failure_
printf 'second\n' > exp2 || framework_failure_
cat exp1 exp2 > in || framework_failure_
split -e -n l/2 in || framework_failure_
compare exp1 xaa || fail=1
compare exp2 xab || fail=1
Exit $fail
```
Relevant test output:
```
+ diff -u exp1 xaa
--- exp1 2023-12-03 12:42:50.511334991 +1300
+++ xaa 2023-12-03 12:42:50.513334908 +1300
@@ -1 +1,2 @@
first
+second
```
and
```
+ diff -u exp2 xab
diff: xab: No such file or directory
```
In other words, it doesn't split the file at all, despite it containing
two lines of content.
The bug is still present in current master (commit
73d119f4f8052a9fb6cef13cd9e75d5a4e23311a).
Bisected on NixOS 23.11 using the following script:
```
#!/bin/sh
set -e
export CFLAGS=-w # Avoid build failure
git submodule update
git clean -fdx --exclude=bisect.sh --exclude=tests/split/l-chunk2.sh
./bootstrap
autoconf
./configure
make
make check TESTS=tests/split/l-chunk2.sh SUBDIRS=.
```
and these commands:
```
git bisect start master v9.1
git bisect run ./bisect.sh
```
Cheers
Victor
next reply other threads:[~2023-12-03 0:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-03 0:25 Victor Engmark via GNU coreutils Bug Reports [this message]
2023-12-03 9:37 ` bug#67593: `split --number=l/N` no longer splits evenly Paul Eggert
2023-12-03 13:17 ` Pádraig Brady
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-coreutils
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e965589eeb832a95c0d107345244e928f57f060d.camel@engmark.name \
--to=bug-coreutils@gnu.org \
--cc=67593@debbugs.gnu.org \
--cc=victor@engmark.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).