* src/nl.c (main): Enforce the POSIX specified
behavior of assuming ':' is specified after a single
character argument to -d.
* tests/misc/nl.sh: Add a test case.
* NEWS: Mention the bug fix.
ls no longer crashes when printing the SELinux context for unstatable files.
[bug introduced in coreutils-6.9.91]
+ nl now handles single character --section-delimiter arguments,
+ by assuming a second ':' character has been specified, as specified by POSIX.
+ [This bug was present in "the beginning".]
+
rm no longer skips an extra file when the removal of an empty directory fails.
[bug introduced by the rewrite to use fts in coreutils-8.0]
}
break;
case 'd':
- if (strlen (optarg) == 2) /* POSIX. */
+ len = strlen (optarg);
+ if (len == 1 || len == 2) /* POSIX. */
{
char *p = section_del;
while (*optarg)
EOF
compare exp out || fail=1
+# Ensure single char delimiters assume a following ':' character (as per POSIX)
+# coreutils <= v8.32 didn't match single char delimiters at all
+printf '%s\n' a x:x: c > in.txt || framework_failure_
+nl -d 'x' in.txt > out || fail=1
+cat <<EOF > exp
+ 1 a
+
+ 1 c
+EOF
+compare exp out || fail=1
+
Exit $fail