Support .pc file without a trailing newline #70

Closed
dumbbell wants to merge 1 commits from support-non-newline-terminated-pc-file into master
dumbbell commented 2014-07-31 14:33:25 +00:00 (Migrated from github.com)

Some editors write text files without a newline character at the end of the last line.

Before this change, the main loop in pkg_new_from_file() expected a newline character at the end of the line and overwrote it with a NUL character. In the case of the last line in a non-newline-terminated file, this ate the last character of that line.

Now, the pkg_fgetline() function takes care of returning a line without the newline character (or the \r\n sequence in case of a DOS file format).

This happens with cppunit.pc from the CppUnit project.

Some editors write text files without a newline character at the end of the last line. Before this change, the main loop in `pkg_new_from_file()` expected a newline character at the end of the line and overwrote it with a NUL character. In the case of the last line in a non-newline-terminated file, this ate the last character of that line. Now, the `pkg_fgetline()` function takes care of returning a line without the newline character (or the `\r\n` sequence in case of a DOS file format). This happens with `cppunit.pc` from the [CppUnit](http://sourceforge.net/projects/cppunit/) project.
bapt commented 2014-08-02 12:08:14 +00:00 (Migrated from github.com)

Merged thank you

Merged thank you

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ariadne/pkgconf#70
There is no content yet.