# GNU Coreutils fixes nl header misidentification bug on empty delimiter

> **Key takeaway:** The nl numbering utility no longer incorrectly classifies empty lines as section headers when invoked with an empty string delimiter argument.

**Published:** 2026-10-28T01:16:03+00:00 
**Source:** GNU Coreutils Releases &amp; Commits 
**Category:** system-core 
**Canonical URL:** https://fosswire.org/news/gnu-coreutils-fixes-nl-header-misidentification-bug-on-empty.html 

## Summary
A bug fix in GNU Coreutils corrects behavior in the nl command, which numbers lines in files. When users passed an empty string to the -d/--section-delimiter option, the utility erroneously treated every empty line as a section header, causing incorrect line numbering and header counting. The fix adds a length check in the check_section function to skip zero-length delimiters. Anthropic's OSS Scanner discovered the flaw, designated ANT-2026-PDYYNTYZ.

The patch modifies src/nl.c, adds regression coverage in tests/nl/nl.sh, and updates the NEWS file. This is a maintenance release with no version bump specified in the source. The change prevents silent data corruption in scripts that rely on nl for structured text processing, particularly in automated document generation and log analysis pipelines.

## What changed in nl and why it matters
- **Section delimiter validation:** The check_section function in src/nl.c now explicitly tests whether the section delimiter string has zero length before attempting to match it against line content.
- **Empty line handling:** Previously, a zero-length delimiter caused the comparison logic to succeed on every empty line, promoting each to a section header and resetting line numbering counters inappropriately.
- **Test coverage:** A new test case in tests/nl/nl.sh verifies that empty -d arguments no longer trigger header misclassification, preventing future regressions.
- **External discovery:** The bug was identified by Anthropic's automated OSS Scanner, highlighting the growing role of AI-assisted vulnerability detection in foundational C utilities.

## Why it matters
GNU Coreutils underpins virtually every Linux distribution and POSIX-compatible system, making even minor utility fixes broadly relevant for shell scripting reliability. System administrators and build pipeline maintainers who use nl for document preprocessing or log formatting will benefit from more predictable behavior when customizing delimiter behavior.