Support .pc file without a trailing newline #70

Closed
dumbbell wants to merge 1 commits from support-non-newline-terminated-pc-file into master

1 Commits (master)

Author SHA1 Message Date
Jean-Sébastien Pédron b748b16a1f Support .pc file without a trailing newline
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).
2014-07-31 16:15:31 +02:00