Skip to content

Line containing only spaces considered an error #1

@mthuurne

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.

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