aboutsummaryrefslogtreecommitdiff
path: root/libpkgconf/fileio.c
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-09-19 17:21:01 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-09-19 17:22:11 +0300
commitdf3f033ad8586bb28503d204eac4e02990f64a44 (patch)
tree46edf90619a86d16cfaeaf12408e7fe486349e75 /libpkgconf/fileio.c
parent2ac205d1d0aaff43513471b0e185b8a9a2487d9a (diff)
Fix some escaping related issues
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 */