summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-09 20:42:11 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-09 20:42:11 +0000
commit22b56d3d2db211468f040772529e56fd16bb2151 (patch)
tree8df57916fb1229d55b10fc0334e442409c87a492
parentacb36ba1ab66c907b17511102768da07264e86d6 (diff)
downloadportage-22b56d3d2db211468f040772529e56fd16bb2151.tar.gz
portage-22b56d3d2db211468f040772529e56fd16bb2151.tar.bz2
portage-22b56d3d2db211468f040772529e56fd16bb2151.zip
Bug #280690 - Fix incorrect idendification of start quote as end quote when
the start quote is immediately followed by a newline. svn path=/main/trunk/; revision=13959
-rwxr-xr-xbin/filter-bash-environment.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/filter-bash-environment.py b/bin/filter-bash-environment.py
index 42ebd7447..381199617 100755
--- a/bin/filter-bash-environment.py
+++ b/bin/filter-bash-environment.py
@@ -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: