Skip to content

Commit

Permalink
Allow ANNOUCE values to contain newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-turney committed Aug 21, 2023
1 parent 9975e05 commit 2e4fae6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,17 @@ def cygport_vars(fn):
output = re.sub(r'^\x1b.*\*\*\* Info:.*\n', r'', output, flags=re.MULTILINE)

for m in re.finditer(r'^(?:declare -[-r] |)(.*?)=(?:"|\$\')(.*?)(?:"|\')$', output, re.MULTILINE | re.DOTALL):
name = m.group(1)

value = m.group(2)
# handle shell escapes in a $'' value
value = value.replace(r'\n', ' ')
if name == 'ANNOUNCE':
value = value.replace(r'\n', '\n')
else:
value = value.replace(r'\n', ' ')
value = value.replace(r'\t', ' ')

var_values[m.group(1)] = value
var_values[name] = value
logging.info('%s="%s"' % (m.group(1), value))

# workaround for a bug cygport
Expand Down

0 comments on commit 2e4fae6

Please sign in to comment.