mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Correct parser to ignore escaped quotes when not in quotes already
Related to #8481
This commit is contained in:
parent
e66e4adedc
commit
9f34ea54f5
1 changed files with 2 additions and 2 deletions
|
@ -26,9 +26,9 @@ def _get_quote_state(token, quote_char):
|
|||
for idx, cur_char in enumerate(token):
|
||||
if idx > 0:
|
||||
prev_char = token[idx-1]
|
||||
if cur_char in '"\'':
|
||||
if cur_char in '"\'' and prev_char != '\\':
|
||||
if quote_char:
|
||||
if cur_char == quote_char and prev_char != '\\':
|
||||
if cur_char == quote_char:
|
||||
quote_char = None
|
||||
else:
|
||||
quote_char = cur_char
|
||||
|
|
Loading…
Reference in a new issue