Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 222091 | Differences between
and this patch

Collapse All | Expand All

(-)bin/filter-bash-environment.py (-2 / +7 lines)
Lines 25-30 Link Here
25
		close_quote_match.group(1) == quote
25
		close_quote_match.group(1) == quote
26
26
27
def filter_bash_environment(pattern, file_in, file_out):
27
def filter_bash_environment(pattern, file_in, file_out):
28
	# Filter out any instances of the \1 character from variable values
29
	# since this character multiplies each time that the environment
30
	# is saved (strange bash behavior). This can eventually result in
31
	# mysterious 'Argument list too long' errors from programs that have
32
	# huge strings of \1 characters in their environment. See bug #222091.
28
	here_doc_delim = None
33
	here_doc_delim = None
29
	in_func = None
34
	in_func = None
30
	multi_line_quote = None
35
	multi_line_quote = None
Lines 32-38 Link Here
32
	for line in file_in:
37
	for line in file_in:
33
		if multi_line_quote is not None:
38
		if multi_line_quote is not None:
34
			if not multi_line_quote_filter:
39
			if not multi_line_quote_filter:
35
				file_out.write(line)
40
				file_out.write(line.replace("\1", ""))
36
			if have_end_quote(multi_line_quote, line):
41
			if have_end_quote(multi_line_quote, line):
37
				multi_line_quote = None
42
				multi_line_quote = None
38
				multi_line_quote_filter = None
43
				multi_line_quote_filter = None
Lines 59-65 Link Here
59
								(declare_opts, line[readonly_match.end():])
64
								(declare_opts, line[readonly_match.end():])
60
						else:
65
						else:
61
							line = "declare " + line[readonly_match.end():]
66
							line = "declare " + line[readonly_match.end():]
62
					file_out.write(line)
67
					file_out.write(line.replace("\1", ""))
63
				continue
68
				continue
64
		if here_doc_delim is not None:
69
		if here_doc_delim is not None:
65
			if here_doc_delim.match(line):
70
			if here_doc_delim.match(line):

Return to bug 222091