commit:     b6866cb7cbe9172ad2ac46e5e72b71901ec44841
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu May  2 15:16:16 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu May  2 15:16:16 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=b6866cb7

libq/cache: fix handling of (escaped) quotes in cache_read_file_ebuild

Bug: https://bugs.gentoo.org/684252
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 libq/cache.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libq/cache.c b/libq/cache.c
index b11e068..ee3a47c 100644
--- a/libq/cache.c
+++ b/libq/cache.c
@@ -429,8 +429,11 @@ cache_read_file_ebuild(cache_pkg_ctx *pkg_ctx)
                                                for (r = p - 1; r > q; r--)
                                                        if (*r != '\\')
                                                                break;
-                                               if (r != q && (p - 1 - r) % 2 
== 1)
+                                               if (r != q && (p - 1 - r) % 2 
== 1) {
+                                                       /* escaped, move along 
*/
+                                                       p++;
                                                        continue;
+                                               }
                                        }
                                        break;
                                } while (1);

Reply via email to