cp,mv --update no longer overrides --interactive or --force.
[bug introduced in coreutils-9.3]
+ csplit no longer creates empty files given empty input.
+ [This bug was present in "the beginning".]
+
ls and printf fix shell quoted output in the edge case of escaped
first and last characters, and single quotes in the string.
[bug introduced in coreutils-8.26]
}
}
-/* Return the line number of the first line that has not yet been retrieved. */
+/* Return the line number of the first line that has not yet been retrieved.
+ Return 0 if no lines available. */
static intmax_t
get_first_line_in_buffer (void)
{
if (head == nullptr && !load_buffer ())
- error (EXIT_FAILURE, errno, _("input disappeared"));
+ return 0;
return head->first_available;
}
first_line = get_first_line_in_buffer ();
- if (first_line > last_line)
+ if (! first_line || first_line > last_line)
{
error (0, 0, _("%s: line number out of range"),
quote (global_argv[argnum]));
if (no_more_lines () && suppress_matched)
handle_line_error (p, repetition);
- linenum = get_first_line_in_buffer ();
+ if (!(linenum = get_first_line_in_buffer ()))
+ handle_line_error (p, repetition);
+
while (linenum++ < last_line_to_save)
{
struct cstring *line = remove_line ();
csplit in '/x\{1\}/' '{*}' > /dev/null || fail=1
cat xx?? | compare - in || fail=1
+# Ensure file not created for empty input
+# which was the case with coreutils <= 9.5
+rm -f xx??
+csplit /dev/null 1 >/dev/null 2>err && fail=1
+test -f xx00 && fail=1
+cat <<\EOF > experr
+csplit: '1': line number out of range
+EOF
+compare experr err || fail=1
+
Exit $fail