Bug #280690 - Fix incorrect idendification of start quote as end quote when the start...
authorZac Medico <zmedico@gentoo.org>
Sun, 9 Aug 2009 20:42:11 +0000 (20:42 +0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 21 May 2012 22:32:17 +0000 (15:32 -0700)
svn path=/main/trunk/; revision=13959

bin/filter-bash-environment.py

index 42ebd744745d22d52fe24cc8d02bec7dd36d532d..381199617e370f6069917f4af643c7a5bd901b1f 100755 (executable)
@@ -48,7 +48,12 @@ def filter_bash_environment(pattern, file_in, file_out):
                                quote = var_assign_match.group(3)
                                filter_this = pattern.match(var_assign_match.group(2)) \
                                        is not None
-                               if quote is not None and not have_end_quote(quote, line):
+                               # Exclude the start quote when searching for the end quote,
+                               # to ensure that the first quote is not identified as the
+                               # end quote (happends if there is a newline immediately after
+                               # the start quote).
+                               if quote is not None and not \
+                                       have_end_quote(quote, line[var_assign_match.end(2)+2:]):
                                        multi_line_quote = quote
                                        multi_line_quote_filter = filter_this
                                if not filter_this: