Add a patch to stream spaces after quoted newlines

This fix .pc files with multi line fields
This commit is contained in:
Baptiste Daroussin 2015-03-02 21:05:15 +00:00
parent cd8c93613e
commit 6e16aa8e9b
2 changed files with 30 additions and 0 deletions

View file

@ -2,6 +2,7 @@
PORTNAME= pkgconf
PORTVERSION= 0.9.7
PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://rabbit.dereferenced.org/~nenolod/distfiles/ \
http://files.etoilebsd.net/pkgconf/

View file

@ -0,0 +1,29 @@
diff --git fileio.c fileio.c
index fed3da9..2e15833 100644
--- fileio.c
+++ fileio.c
@@ -37,13 +37,22 @@ pkg_fgetline(char *line, size_t size, FILE *stream)
else if (c == '\n')
{
- *s++ = c;
-
if (quoted)
{
+ /* Trim spaces */
+ do {
+ c2 = getc(stream);
+ } while (c2 == '\t' || c2 == ' ');
+
+ ungetc(c2, stream);
+
quoted = false;
continue;
}
+ else
+ {
+ *s++ = c;
+ }
break;
}