8000 Line containing only spaces considered an error · Issue #1 · pcercuei/libini · GitHub
[go: up one dir, main page]

Skip to content

Line containing only spaces considered an error #1

Open

Description

@mthuurne

An empty line is considered a comment line. But a line that contains nothing but spaces causes the "Unexpected end of line" error message to be printed. I think this is too harsh: while there is no reason to put spaces on an otherwise empty line, it can happen by accident and debugging a problem like that is really tricky for a developer.

Related to this, whitespace next to the "=" sign is skipped, but whitespace and the start and end of a line is not. Perhaps it might be better to skip whitespace except in the middle of a value or section name.

Note that the current code uses "*curr <= ' '" to check for whitespace in the key parsing loop, while after the "=" sign only space and tab are considered whitespace. It would be better to use a single definition of whitespace; maybe even make an inline function that checks for whitespace.

Activity

  1. rgetz commented on Jan 4, 2026

    @rgetz
    Contributor

    I think that PR #6 resolves most of these issues. Feel free to check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0