Skip to content

Missing newline character at end of DC file leads to last line of DC file being ignored #553

@ghost

Description

If there is no newline at the end of a DC file, its last line will be ignored. Most editors create final newlines automatically, so the situation where this bug appears is surprisingly rare. However, it is still easy to reproduce:

  1. Create a DC file without trailing newline char: echo -n 'MAIN=some_doc.xml' > DC-test

  2. Validate your document:

    > daps -d DC-test validate 
    ERROR:  is an unsupported file type (.)
    must be ASCIIDOC (.adoc) or DocBook (.xml)
    

Counter-example

  1. Create a DC file with trailing newline char: echo 'MAIN=some_doc.xml' > DC-test-good

  2. Validate your document, note that you get a different error message that actually relates to the file we wanted to build:

    > daps -d DC-test-good validate 
    ERROR: Source files must reside in an "xml/" directory. "/home/sknorr-l/data/gits/sbp/xml/some_doc.xml" is not a valid location.
    
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions