From df3f033ad8586bb28503d204eac4e02990f64a44 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 19 Sep 2017 17:21:01 +0300 Subject: Fix some escaping related issues --- libpkgconf/fileio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libpkgconf/fileio.c') 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 */ -- cgit v1.1