aboutsummaryrefslogtreecommitdiff
path: root/libpkgconf/fileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'libpkgconf/fileio.c')
-rw-r--r--libpkgconf/fileio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libpkgconf/fileio.c b/libpkgconf/fileio.c
index d1c848f..bcc9c50 100644
--- a/libpkgconf/fileio.c
+++ b/libpkgconf/fileio.c
@@ -28,12 +28,16 @@ pkgconf_fgetline(char *line, size_t size, FILE *stream)
while (s < end && (c = getc(stream)) != EOF)
{
- if (c == '\\')
+ /*
+ * Fix double-backslash swallowing (issue #140 is reported).
+ */
+ if (c == '\\' && !quoted)
{
quoted = true;
continue;
}
- else if (c == '#')
+
+ if (c == '#')
{
if (!quoted) {
/* Skip the rest of the line */